How do i restrict multiple choice response to only 3 answers?
There actually an example of precisely this here: Form Operators and Functions - ODK Docs
Basically, you just need to use the count-selected()
function in a constraint. If you require exactly three responses then use ‘=’ in the constraint; if you want a maximum of three then use ‘<=’ instead.
Hi everyone - very helpful thread! And, a follow up: I struggle to find the actual “Count-Selected () function” where I can insert <= … where is it? Is this function available in the free global version of Kobo? Fingers crossed Grateful for some guidance on how to figure it out.
count-selected() ; use it on CONSTRAINT column, if you want to restrict someting;
Other wise it can be use for other purposes like relevance, repeat-count etc.
count-selected() - count the number of choise which have been selected on a multiple select question.
Thanks! And hope you dont mind me asking for some additional clarification. Where exactly can I find this function? I’ll paste a screen shot of how the settings look when I open the settings for the multiple choice. I am using the free global version and start to think that this function is not available there? Thanks a lot!
on Validation Criteria.
Now your screenshot tells a lot.
My Reccomendation: 1. Do not create XLSX on builder. I would suggest you use Excel to build your forms. It is fast , easy , efficient. This will help you build complex forms with hassle.
I dont mean the online builder is not good but using EXCEL will make things a bit easier
You can download a well organize template here:: https://github.com/getodk/xlsform-template/raw/main/ODK%20XLSForm%20Template.xlsx