Want code such that when you select say District 1, then only Villages 1,2,3

Am creating a survey tool and coding in Excel Form. I have say District 1 District 2 …upto 5. Under the districts I have several villages 1, 2, 3 upto 11. I want code such that when you select say District 1, then only Villages 1,2,3 appear as options for selection and the rest of the villages do not appear. Please assist on how I can code this

Hello @LastyJakom,
Please read the below post, it will help you to solve your problem. After that if you face any issues. late me know.
https://support.kobotoolbox.org/cascading_select.html

1 Like

Hello Bulbul, let me give an example I have three states lets name them state1, state2 and state3. Under districts list I have about 10. District1, District2, District3 upto 10. Now in my Survey I want it such that when you choose State1, in the next screen I should see only District1 and District2 appearing as options and not all the 10. I have tried the above but it’s not working may be I didn’t follow correctly in my XLS Form

Hi @LastyJakom, Please share your XLSForm with us.

1 Like

The key is you have to have add a choice_filter to the dependent select question; this filters the presented options according to what was previously selected for the state question. In your case, you want to filter the presented districts to only those districts that match your previously selected state. That is,

choice_filter: state = ${selectedState}

Have the play around with the following form; hopefully its readily apparent how this works (if not please post back).

Screenshot 2024-08-17 at 6.50.46 PM

CascadeSelect.xlsx (18.2 KB)

[BTW, strictly speaking this isnt “Skip Logic”; that term is typically used to refer to when you want to show or hide entire questions (or groups!) depending on some condition, and this requires a completely different approach].

2 Likes
(attachments)

PENHA Community Survey Tool_Final.xlsx (19.4 KB)

Thanks Dr. Gareth it works.

1 Like