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?
Sorry, that didn't show up in time before I posted my answer...
Hm, that also does not work 😞
Should it give already the constraint_message when clicking the forth option or only when the data is validated?
Should that be in the relevant field or in the constraints?
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
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).