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.
Note: The function doesn’t work (yet) with dynamic multiple choice fields.
chosen(multi)
chosen(multi, string)
chosen(multi, number)
chosen(multi, [number])
boolean
[string]
We have a multiple-choice Favorite sports field with the following choice values:
Favorite sport | ID | Selection |
---|---|---|
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. 1
chosen('Favorite sports', [1, 3, 5])
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.1
chosen('Favorite sports', 4)
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. chosen('Favorite Sports', "Dancing")
Result: Yes (
true
)
(Dancing is the relevant selection, the others are not relevant)
chosen('Favorite Sports', "Climbing")
Result: No (
false
)
chosen(myMultiChoice)
To get all chosen values from a multiple-choice field. chosen('Favorite Sports')
Result: Basketball,Dancing,Sailing,Soccer
chosen('Favorite sports') = "Dancing"
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.Last modified 4mo ago