Count number of selected items in a selection field

From SMTX Wiki
Jump to navigation Jump to search

If you have a multi-selection field, and you want the know how many entries were chosen, you can use this :

Iif ('#REPLACE-FORMFIELD-testCount||AllEmailAddresses||#' = , 0, ForEachString('#REPLACE-FORMFIELD-testCount||AllEmailAddresses||#', '||' , '1','+', 1))

Explanation: - The user selects x email addresses in the field 'AllEmailAddresses' - paste the code above in a secondary field, enable calculations, and it will show you the number of selected entries.

sample form: https://dev.ssp7.smt-x.com/Forms/Admin/formDetail.aspx?tab=1&id=888&ActiveFieldId=19782