/
VALUE_CONTAINS ()

VALUE_CONTAINS ()

VALUE_CONTAINS (search_into, search_value[, true_value] [, false_value])

Verifies whether the value specified in search_value is one of the values contained in search_into

Input Parameters

search_intoarrayCan be question reference, OBJECT CODE, array or FORMULA
search_valuestringCan be question reference, OBJECT CODE, string or FORMULA. Must be a single value (not an array)
true_valueany

Optional. Is the value returned by the FORMULA when the value search_value is one of the values contained in search_into

If not provided, the default value is 1

false_valueany

Optional. Is the value returned by the FORMULA when the value search_value is NOT one of the values contained in search_into

If not provided, the default value is 0

Execution

Always

Examples

FORMULAReturn value
VALUE_CONTAINS(FORM.DATA.ORGAN, "HEART")Returns 1 if "HEART" is found in the string or array returned by the evaluation of the OBJECT CODE FORM.DATA.ORGAN
VALUE_CONTAINS(["LIVER", "LUNG", "HEART"], "HEART", "existent", "inexistent")Returns "existent"
VALUE_CONTAINS($23, "HEART", "existent", "inexistent")Returns "existent" if "HEART" is found in the question referenced by $23 (in the same FORM where the FORMULA is executed)





Related content