Hiding choices based on yes/no response from previous questions

I want to design a form, such that questions 1 to 20 is a yes/no question.

Then, question 21 is a select one question with 20 choices/options.

Now in question 21 I want option 1 to show only if question 1 is yes, option 2 to show only if question 2 is yes, option 3 to show only if question 3 is yes, etc.

How do I go about this?

@johnsonariyo, you could do it as outlined in the image shared below:

In the survey tab of your xlsform:

In the choices tab of your xlsform:

Image 2

Data entry screen as seen in Enketo: when nothing is selected

Data entry screen as seen in Enketo: when no is selected in all the questions

Data entry screen as seen in Enketo: when yes is slected in one question

Data entry screen as seen in Enketo: when yes is selected in two questions

Data entry screen as seen in Enketo: when yes is selected in all three questions

Reference xlsform:

Hiding certain choices.xlsx (11.5 KB)

2 Likes

Hi @Kal_Lam,
Why do we need allow_choice__dupliates here?

1 Like

Thank you for pointing this out @wroos! No need to use the allow_choice_duplicates. I had initially tried using duplicate choices and then forgot to delete the same. Have now updated the post.

1 Like

Thank you Kal_Lam. It really worked out.

1 Like