I want to create a selection list (select_one) which should be filtered regarding the option selected in another selection list (select_one).
The first select_one contains the 7 characters of the second select_one. What I want is that for the second select_one only display those options matching the 7 characters of the first select_one.
The file can be downloaded using the following link: “removed link”
Welcome to the community! You could design your survey form with the
cascading select question to get what you have tried for by following the support article here. As a backup you could also have a look at the post that has a simple workaround that should help you understand the concept of
cascading select question:
But looking at your xlsform, i see there are more then 800 choices which should affect your data entry performance. Thus a solution for this could be designing a form combining
cascading select question type with
select_one_from_file question type as outlined in the image below:
In the survey tab of your xlsform:
In the choices tab of your xlsform:
Data entry screen as seen in Enketo:
select_one_from_file.xlsx (15.8 KB)
Reference csv file:
CDC_Code.csv (35.5 KB)
Please feel free to have a look at our support article Select one or many from external file question type to learn more on
select_one_from_file question type.
Have a great day!
Hello @esmatullaharifi ,
As your token is part of the name of the second choice, and the names have a structured format, you could also use a substring function (see https://getodk.github.io/xforms-spec/#fn:substr) together with a choice_filter.
FilterSubstr01.xlsx (24.2 KB)
It works after some time to load first.
I guess the solution of @Kal_Lam with an explicit cascade column and the pull data will be more performant.
This is gold, I was just looking to do this cascading with external csv.
In my case, I needed a 3rd list cascading from the 2nd one.
It’s not working with Enketo, but it works great with ODK Collect v1.27.2.
I have a list of 8,500+ villages in 150 districts and it loads pretty fast.
Glad that it was a help for you!
Have a great day!
Having reviewed this even further. You can actually achieve this without mentioning select_one_from_file by using the following coding approach which uses the search functionality.
With the above, you could actually achieve to have all your data in one csv and just call the one you need using the search() command.
Thanks… So apt…
Hi, can u show the snapshot of csv file of both the questions?
I believe the following post will address your concerns
sure.I wil chk this out.
Many thanks for ur concern & helping out sir