Setting a double constraint for multiple_select

In a select_multiple item, how do I prevent the possible selection of 'Don't know' and/or 'Not applicable' at the same time with other option.
Let 'Not applicable' be 96 and
'Don't know' be 99.

I’d love to help, but your post does not contain enough information for me to answer your question. In general, the best way to get help is to fill out the questions in the pre-filled template that you get when you create a support post. So, with that in mind, can you answer these questions?

What ODK tool and version are you using? And on what device and operating system version?
And if possible could you upload your form so, I can help more and understand your question more easily.

Narendra

Try the following in the constraint column

not(selected(., '99') and count-selected(.) >=2)

Where '99' is the value for "Don't know" and "2" represents 2 or more choices are selected. I would include a constraint message along the lines of "Don't Know can not be selected with other responses"

@Fadl; please introduce yourself HERE when you get a chance, it helps build the community.

2 Likes

Hi everyone!

My team and I came up with this constraint at the office yesterday and it worked perfectly..................

not(count-selected(.) >1 and selected(.,'96')) and not(count-selected(.) >1 and selected(.,'99'))

With the constraint message as..................................

You cannot select 'Don't Know' or 'Not Applicable' with any other answer option.

3 Likes