How to omit some choices depending on a previous select_one response

1. What is the problem? Be very detailed.
I can't figure out how to display only a subset of choices for a question restricted by a previous select_one response. Example:
Q1. Choose one of 3 restaurants (A,B,C)
Q2. What is your favourite dish in selected restaurant above?
Now restaurants A & B each offer only 3 dishes (d1, d2, d3) but restaurant C offers two more (d4,d5). If A or B is selected in Q1 how do I display only choices d1 to d3, OR if C is selected, all five dishes?

2. What app or server are you using and on what device and operating system? Include version numbers.
ODK Collect v1.26.3 on android

3. What you have you tried to fix the problem?
Not sure how to apply any of the functions or filter methods for this case.

I think one of the attached files in this previous conversation probably does what you want.

The choice_filter functionality should allow you to limit the dishes by restaurant or whatever combination of questions you will use.

Hi @Gichuki

choice_filter is what you need as @noel_cartong mentioned. here is a sample form that should help you because the construction should be similar:
choiceFilter.xls (9.5 KB)
If it's not enough for you please attach your xls form.

Thanks. See attached sheet to better understand my query. Two hotels only offer the same 3 dishes, but third hotel offers the same 3 plus additional 2 (offers all dishes on list)

hotels_dishes.xlsx (24.4 KB)

Hi @Gichuki

check the form above :

  • choices sheet,
  • choice_filter column of the survey sheet
  • and settings sheet to allow_choice_duplicate

hotels_dishes.xlsx (22.2 KB)

Yes, use of choice duplicates works ok, thanks, but I wonder if there's an alternative way of getting the same results especially when the Hotels and dishes are many? e.g. 10 hotels and 100 dishes.
Of course the duplicates method would still work, but I'd need to make many more duplicates.

Yes you can to id :slight_smile:

hotels_dishes.xlsx (22.2 KB)

the test and ${hotel} != '' in the choice_filter column is here to first show an empty list of dishes.

1 Like

@mathieubossaert this works great!
Thanks @Grzesiek2010 , @noel_cartong