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:

Favorite sportIDSelection

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.

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.

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.

See also

contains, which checks if a given string contains the exact given match.

Last updated