Limiting responses for a select multiple question


I want to know if it is possible to limit number of responses for select many questions. For example, I have 5 choices and I only want respondents to select only 2, Thank you in advance for your suggestions.

1 Like

Try this - you can add a constraint to your select_multiple like:

constraint: "count-selected(.) = 2"

Sample form:

countselected.xls (5.5 KB)

See count-selected() for details. BTW if you want at most 2 then use ‘<=’


Thank you very much!


I have a follow-up question, I understand the count-selected ( multi_select_question ) function will return the number of choices selected. What if you want to limit the total number of responses that can be selected say to 2 out of 5 responses. I have tried the recommendation but I can still select more than 2 choices, please help.

Hi @Dexter,

Welcome to the community! Follow the instructions outlined by Xiphware in post 2. It should solve your issue. However, if it does not, please feel free to share your xlsform with the multiple select question here so that we could correct the syntax error from your xlsform.

Have a great day!

1 Like

thank you @Kal_Lam

This was solved.

1 Like