Can only say yes to one question out of two

Hi there,

I have two questions in my form:

Uni-lateral ear pain? Yes/No/Unknown

Bi-lateral ear pain? Yes/No/Unknown

How do I make it so if they say yes to one, they cannot say yes to the other?

Many thanks!

Faran

I think this does what you need: ear_pain.xlsx (9.7 KB)

+----------------+----------------+-----------------------+------------------------------------------+
|      type      |      name      |         label         |                constraint                |
+----------------+----------------+-----------------------+------------------------------------------+
| select_one ynu | unilateral_ear | Uni-lateral ear pain? | not(.='yes' and ${bilateral_ear}='yes')  |
| select_one ynu | bilateral_ear  | Bi-lateral ear pain?  | not(.='yes' and ${unilateral_ear}='yes') |
+----------------+----------------+-----------------------+------------------------------------------+

(Make sure to include a constraint_message to inform your users why they might be getting an error message.)

Or, could you change your question to the following?

Ear pain? yes, bi-lateral ear pain / yes, uni-lateral ear pain / no, no ear pain / unknown

1 Like

That worked perfectly - thank you Dan!