How do we change the choices options (in the following question) based on the choices selected in the previous question when both questions are select multiple question type?

I’m building a questionnaire with 2 multiple-choice questions, and I want to short the answers of 2nd question based on 1st question’s choices.
For examble:
Select_mutiple Q1: what’s your position: A B C
Select_mutiple Q2: What do your need : x y z t, other
What I want in Q2:
show x, y, other if q1 = A,
show y, z, other if q1 = B,
show x, t, other if q1 = C,
show x, y, t, other if q1 = A & C,
show x, y, z, t, other if q1 = A, B and C

Many thanks!

What should it show if A & B are selected in Q1? Similarly, what should it show if B & C are selected in Q1? It seems like these two conditions are missing too.

1 Like

If Q1 = A&B, Q2 will show x, y , z, other
and if Q1 = B & C, Q2 will show x, y, z, t, other (similar with choosing all A, B, C in Q1)

In Q2, x, y always be relevant with answer A
y and z always be relevant with answer B
x and t always be relevant with answer C

So, if Q1 = A& B, Q2 will be x, y, z, similar with other conditions

1 Like

Do we have any solution for this?

@kienl, you could do this as outlined in the image shared below:

In the survey tab of your XLSForm:

In the choices tab of your XLSForm:

Data entry screen as seen in Enekto: when nothing is selected in Q1

Data entry screen as seen in Enekto: when some choices are selected in Q1

Reference XLSForm:

Cascading Select in a Select Multiple Question.xlsx (12.8 KB)

1 Like

It’s worked.
Thank you so much.

1 Like

Another way is to use selected(${name},filter) instead of filter=${name} in the choice_filter column. No changes needed at the choices tab.

3 Likes

@daryna_avd, :clap: :heart: :partying_face:

Hi @Kal_Lam !
Thanks for the guidelines.

I am trying the same, but our question is within the group, the formula given seems not to work for me. Possible to help?

Need is:
BeginGroup
Sex: Male, Female
Guardian: Father/Husband
EndGroup

If the Sex is selected as ‘Male’, Guardian will show only option ‘Father’
If the Sex selected is ‘Female’ Guardian will show both options.

Following is the formula I used,

In Choice tab
image

and the error I am getting is after uploading the Xls form:

Any help please?

Hurray! got it fixed with the help of below post.
FormLogicError: could not evaluate: selected - User Support / Form Building - KoboToolbox Community Forum

It was a syntax error with the formula. I did miss single quotes after condition1 & condition2.
:slight_smile:

1 Like

Hi, Thanks for providing the answer, but could you please give a solution (similar to the above-provided xlsform), if the first question is select_multiple and the second question is select_one
thanks in advance