Counting all options in a select multiple choices (Options Have a Choice Filter so the options changes)

Hi Team. I have read but have not come across a solution that counts the number of options in a select multiple lists (All options = Selected + Unselected). List that changes based on the set filter meaning the list will be changing based on a selection made. How can I urgently solve this. Please Help.


It’s complicated: You could probably use count() and instance() with the choice-filter (see Form Datasets - ODK Docs). See an unfiltered example here Counting the number of all options in a select_one / select_multiple variable - #28 by Xiphware - Ideas - ODK Forum.

Do you mean a (dynamic) choice_filter here?
Or do you mean the total unfiltered list of choices in the choice list?

Are you using Collect or Enketo?

1 Like

@joe.phiri, this post discussed previously should help you solve your issue:

Hi @Kal_Lam,
the requirement might be different, please

1 Like

Hi @Kal_Lam , Am looking at a dropdownlist that is not static as in, The total option list changes based on the choice filter. How can I count the options that change and not the same for me to get the total options in a list. Thereafter I can use the count-selected to get the selected choices.

The count-selected(…) will work independent of the total choices availables.

You can probably adapt the 2nd linked example above.