Select to view content in your preferred language

How to restrict number of choices in multiple_choices

2479
7
02-19-2016 01:40 AM
by Anonymous User
Not applicable

Next question: How can I restrict the number of choices in a multiple_choices field to for example three? I found that this count-selected(.)<=3. (found it here: https://www.datawinners.com/find-answers-app/xlsform-how-can-i-restrict-the-number-of-selected-answe...

should work but it does not for me. I also tried count-selected<=3 (without the dots), but also that does not work. Andy ideas?

7 Replies
IsmaelChivite
Esri Notable Contributor

Count.png

0 Kudos
IsmaelChivite
Esri Notable Contributor

Count2.png

0 Kudos
by Anonymous User
Not applicable

Sorry, that didn't show up in time before I posted my answer...

0 Kudos
by Anonymous User
Not applicable

Hm, that also does not work 😞

constraint.jpg

Should it give already the constraint_message when clicking the forth option or only when the data is validated?

0 Kudos
by Anonymous User
Not applicable

Should that be in the relevant field or in the constraints?

0 Kudos
IsmaelChivite
Esri Notable Contributor

Hi Nicole,

  it depends on what you want.  The relevant expression is useful on a Note to give the user a warning.  If you want to truly stop the user from submitting a Form that breaks your rule, then add a constraint in the multiple-choice itself. I added both examples so you could see the options.

Ismael

0 Kudos
IsmaelChivite
Esri Notable Contributor

To close this thread.

The constraint syntax above is correct, but the expression is not executing in your case because your question is operating within a repeat.  This issue is in our backlog at the moment (constraints do not work when within a repeat).