Search…
Resources
Related Links
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.

Syntax

chosen(multi)
chosen(multi, string)
chosen(multi, number)
chosen(multi, [number])

Return

boolean
[string]

Examples

We have a multiple-choice field "Favorite sports" 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 "true" (Yes) if the given numbers representing the choice value IDs are fully covered in the selection.
chosen('Favorite sports', [1, 3, 5])
Result: Yes (true) (Sailing is selected, too, but this is not relevant)
chosen(myMultiChoice, choiceId) To return "true" (Yes) if a given number equals the ID of one of the chosen values.
chosen('Favorite sports', 4)
Result: Yes (true) (Basketball, Dancing, and Soccer are selected, too, but this is not relevant)
chosen(myMultiChoice, myFavoriteSport) To return "true" (Yes) 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 (if only "Dancing" is selected) and No (if "Dancing" is not selected, or also other sports are selected. So "No" 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 modified 10d ago
Export as PDF
Copy link