chosen
To evaluate multiple choice fields
The function determines all selected options of a multiple choice field and returns them in an array. You also can query if a specific value is included in the array.
For dynamic multiple choice fields (until now) only the query via the record IDs is possible.
Syntax
chosen(multi)
chosen(multi, string)
chosen(multi, number)
chosen(dmulit, number)
chosen(multi, [number])
chosen(dmulti, [number])
Return
boolean
[string]
Examples
We have a multiple-choice Favorite sports field with the following choice values:
Basketball
1
x
Climbing
2
Dancing
3
x
Sailing
4
x
Soccer
5
x
Basketball, Dancing, Sailing, and Soccer are selected.
chosen(myMultiChoice, choiceIdList)
To return Yes (true
) the given numbers representing the choice value IDs are fully covered in the selection.
Result: Yes (true
)
(Sailing is selected, too, but this is not relevant)
chosen(myMultiChoice, choiceId)
To return Yes (true
) if a given number equals the ID of one of the chosen values.
Result: Yes (true
)
(Basketball, Dancing, and Soccer are selected, too, but this is not relevant)
chosen(myMultiChoice, searchString)
To return Yes (true
) if a given string equals at least one of the selected choice values.
Result: Yes (true
)
(Dancing is the relevant selection, the others are not relevant)
Result: No (false
)
chosen(myMultiChoice)
To get all chosen values from a multiple-choice field.
Result: Basketball,Dancing,Sailing,Soccer
Result: Yes (true
) if only Dancing is selected and No (false
) if Dancing is not selected, or also other sports are selected. So No (false
) would be the answer in our example. This helps you to filter these records, where only the given value is selected.
See also
contains
, which checks if a given string contains the exact given match.
Last updated