# How to restrict the dependent level selection in Multiple response

Hi Family,
How to restrict the other selection in Multiple response
Avatar
Shamsudini
Yesterday at 21:56 NONE Unfollow
Let say I have the following multiple choice response variable

Types of Food

1. Maize

2. Millet

3. Soghum

4. Other1

5. Other2

6. Other3

7. Other4

8. Other5

So I want to restrict people such that before you select option for other2, other1 must be selected, in other words. Until you select option "other1," you can't select option other2. Until you select "other2" you can't choose "other3", until you choose "other 3", you cant choose "other4" and untill you choose other4 you can't choose other5. etc.

I tried this but it never work out at constraint
if(selected(., 4)) and selected(., 5) or
if(selected(., 5)) and selected(., 6) or
if(selected(., 6)) and selected(., 7) or
if(selected(., 7)) and selected(., 8)
I attache the sample form
Constraint.xlsx (12.8 KB)

Thank you

• if( condition, trueCaseValue, falseCaseValue )
• "or" and "and" must be separated in groups with brackets: ( ... and ....) or (... and ...).
``````It might be helpful to specify a decision table for all valid combinations, e.g.
|any fruit| -- | -- | -- | -- | -- | -- |
|other1   |    |  x |  x |  x |  x |  x |
|other2   |    |    |  x |  x |  x |  x |
|other3   |    |    |    |  x |  x |  x |
|other4   |    |    |    |    |  x |  x |
|other5   |    |    |    |    |    |  x |
‐-‐----------------------------‐---------------------
|         | ok | ok | ok | ok | ok | ok |

( x = selected. -- = doesn't matter)

...``````
1 Like

Hi wroos,
Thank you so much for your feedback.
Please, can you clarify the decion rule again? Where do I set the decision rule, and what will I type in the constraint column?

Thank you

A decision table should just help to clarify the valid combinations. And it can help to write the constraints, e.g.
( (selected(., 'option5name') and selected(., 'option4name') and (selected(., 'option3name') and selected(., 'option2name') and selected(., 'option1name') ) or
( not(selected(., 'option5name') and (selected(., 'option4name') and (selected(., 'option3name') and selected(., 'option2name') and selected(., 'option1name') ) or
... or
( (selected(., 'option1name') and not( selected(., 'option4name') or (selected(., 'option3name') or selected(., 'option2name') ) ) or
( not(selected(., 'option5name') and not(selected(., 'option4name')) and not(selected(., 'option3name')) and not(selected(., 'option2name')) and not(selected(., 'option1name')) ).

I would suggest to develop and test the constraint expression step-by-step. With your 5 other options, you reach 2**5 = 32 possible combinations in total.

If you want to allow/add text entries for the options, you might also consider two other design approaches:

• Having one "others" in the list, and if selected, showing step-by-step visible text entry fields, for up to 5, with only the first one mandatory.
• Having a (manual) repeat group for the other options, after or without one "others" in the initial list.

Hi wroos,
Thank you very much. I will study it carefully and implement it.