# How to do cascading selects in ODK Build

**URL:** <https://forum.getodk.org/t/how-to-do-cascading-selects-in-odk-build/6707>\
**Category:** Support\
**Tags:** odk-build\
**Created:** [June 5, 2017, 1:21pm UTC](https://forum.getodk.org/t/how-to-do-cascading-selects-in-odk-build/6707 "2017-06-05T13:21:18Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bidemi\_Adejumo](https://getodk.b-cdn.net/letter_avatar_proxy/v4/letter/b/3be4f8/32.png) [@Bidemi\_Adejumo](https://forum.getodk.org/u/Bidemi_Adejumo)\
**Post date:** [June 5, 2017, 1:21pm UTC](https://forum.getodk.org/t/how-to-do-cascading-selects-in-odk-build/6707/1 "2017-06-05T13:21:18Z")

</div>

Good  
I need help in if else statement for my work  
Am preparing a form which has an option field.  
Example; Car Brand which car models and years  
**1st Field** - Car brands (Toyota, Honda, Volkswagen etc); when the right one is selected, the next field shows the models. Say Toyota has been selected.  
**2nd Field** - Camry, Corolla, Venza, Highlander etc. Say Camry has been selected  
**3rd Field** - 1985, 1990, 1992, 2005, 2010, 2011, 2012 etc

---

<div class="post-metadata">

**Author:** ![yanokwa](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/yanokwa/32/1695_2.png) [@yanokwa](https://forum.getodk.org/u/yanokwa)\
**Post date:** [June 5, 2017, 3:04pm UTC](https://forum.getodk.org/t/how-to-do-cascading-selects-in-odk-build/6707/2 "2017-06-05T15:04:07Z")

</div>

Welcome to the ODK forum, @Bidemi_Adejumo! When you get a chance, please [introduce yourself here](https://forum.getodk.org/t/introduce-yourself-here/6671).

Thanks so much for using the correct tags on the post. It helps us keep the forum well organized! Speaking of organization, the [Development](https://forum.getodk.org/c/development) category is for posts about the process of building and modifying ODK tools. Form design questions should go into [Support](https://forum.getodk.org/c/support), so I'm moving this question there.

Now that we have that out of the way, I can finally answer your question! If you want to go from makes to models to trims, using [cascading selects](http://xlsform.org/#cascade) is your best bet.

---

<div class="post-metadata">

**Author:** ![Bidemi\_Adejumo](https://getodk.b-cdn.net/letter_avatar_proxy/v4/letter/b/3be4f8/32.png) [@Bidemi\_Adejumo](https://forum.getodk.org/u/Bidemi_Adejumo)\
**Post date:** [June 6, 2017, 8:07am UTC](https://forum.getodk.org/t/how-to-do-cascading-selects-in-odk-build/6707/3 "2017-06-06T08:07:30Z")

</div>

Thanks so much but am using odk build

---

<div class="post-metadata">

**Author:** ![yanokwa](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/yanokwa/32/1695_2.png) [@yanokwa](https://forum.getodk.org/u/yanokwa)\
**Post date:** [June 6, 2017, 1:36pm UTC](https://forum.getodk.org/t/how-to-do-cascading-selects-in-odk-build/6707/4 "2017-06-06T13:36:17Z")

</div>

Cascading selects are a bit of an advanced feature so they aren't currently supported in Build. Maybe @issa can look at what it'd take to add.

Until then, you might want to try exporting your form to [XLSForm](http://xlsform.org/) and see if you can add cascades there.

---

<div class="post-metadata">

**Author:** ![Bidemi\_Adejumo](https://getodk.b-cdn.net/letter_avatar_proxy/v4/letter/b/3be4f8/32.png) [@Bidemi\_Adejumo](https://forum.getodk.org/u/Bidemi_Adejumo)\
**Post date:** [June 7, 2017, 2:41pm UTC](https://forum.getodk.org/t/how-to-do-cascading-selects-in-odk-build/6707/5 "2017-06-07T14:41:14Z")

</div>

Please can you help with the look as i could not figure it out.... Am using odk build to create the forms

---

<div class="post-metadata">

**Author:** ![Souirji\_Abdelghani](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/souirji_abdelghani/32/1604_2.png) [@Souirji\_Abdelghani](https://forum.getodk.org/u/Souirji_Abdelghani)\
**Post date:** [June 9, 2017, 9:06am UTC](https://forum.getodk.org/t/how-to-do-cascading-selects-in-odk-build/6707/6 "2017-06-09T09:06:55Z")

</div>

Hi @Bidemi_Adejumo,

You can first prepare all the items of your form in Build then export the form as a Excel file (XLSFORM).

To do this, in Build Menu you have File, View and Settings; select File, then click Export to XLSFORM then save the exported Excel file.

After that you can open the file in Excel (or OpenOffice/LibreOffice), adapt it and include your cascading following XLSFORM standards (see [http://xlsform.org/](http://xlsform.org/)). Once the form is finished in Excel, validate and transform it to XML, using [http://opendatakit.org/xiframe/](http://opendatakit.org/xiframe/) or Nafundi's handy XLSFORM Offline app. Once you obtain a valid XML form, you can load and use it in ODK Collect.

---

<div class="post-metadata">

**Author:** ![Bidemi\_Adejumo](https://getodk.b-cdn.net/letter_avatar_proxy/v4/letter/b/3be4f8/32.png) [@Bidemi\_Adejumo](https://forum.getodk.org/u/Bidemi_Adejumo)\
**Post date:** [June 9, 2017, 2:55pm UTC](https://forum.getodk.org/t/how-to-do-cascading-selects-in-odk-build/6707/7 "2017-06-09T14:55:09Z")

</div>

Thanks so much. I get that but my main problem is with building the cascading. I've read through the form design help and cant really understand it, to talk of applying it to my current form. Thanks

---

<div class="post-metadata">

**Author:** ![yanokwa](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/yanokwa/32/1695_2.png) [@yanokwa](https://forum.getodk.org/u/yanokwa)\
**Post date:** [June 9, 2017, 4:31pm UTC](https://forum.getodk.org/t/how-to-do-cascading-selects-in-odk-build/6707/8 "2017-06-09T16:31:16Z")

</div>

Forget your current form for now.

Try the state/district/village form that is attached to [http://xlsform.org/#cascade](http://xlsform.org/#cascade). See if you can get that working following Souirji's instructions.

If you get stuck at any step, respond to the thread and describe the steps you've taken, where in the process you are stuck, and how you've tried to get unstuck.

---

<div class="post-metadata">

**Author:** ![Souirji\_Abdelghani](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/souirji_abdelghani/32/1604_2.png) [@Souirji\_Abdelghani](https://forum.getodk.org/u/Souirji_Abdelghani)\
**Post date:** [June 9, 2017, 4:55pm UTC](https://forum.getodk.org/t/how-to-do-cascading-selects-in-odk-build/6707/9 "2017-06-09T16:55:39Z")

</div>

Hi @Bidemi_Adejumo,

Here's an XLSFORM and its XML version doing what you want. I've put arbitrarily 3 different production years for each car model. It is modified from the form indicated by @yanokwa. I think he is right by asking you to try learning XLSFORM as you should if you want to use ODK successfully.

Hope this helps.

[cascading\_select\_cars.xlsx](https://getodk.b-cdn.net/uploads/default/original/2X/f/f2af2ee9b746ae4001ac4f9b70ca94f19c09bbf8.xlsx) (12.8 KB)  
[cascading\_select\_cars.xml](https://getodk.b-cdn.net/uploads/default/original/2X/0/03796adb5582fbadadf6d2711352b2a52be6b607.xml) (13.0 KB)

---

<div class="post-metadata">

**Author:** ![Bidemi\_Adejumo](https://getodk.b-cdn.net/letter_avatar_proxy/v4/letter/b/3be4f8/32.png) [@Bidemi\_Adejumo](https://forum.getodk.org/u/Bidemi_Adejumo)\
**Post date:** [June 13, 2017, 8:06am UTC](https://forum.getodk.org/t/how-to-do-cascading-selects-in-odk-build/6707/10 "2017-06-13T08:06:14Z")

</div>

Good day,  
Thanks so much for your help. The format is a little different when I exported my ODKBIULD form to xls and i became confused. Attached is my form.[Electric Poles\_XLS.xlsx](https://getodk.b-cdn.net/uploads/default/original/2X/5/5d373005c634a7301a1a00a032a27b32635fd4bd.xlsx) (28.8 KB)

---

<div class="post-metadata">

**Author:** ![Souirji\_Abdelghani](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/souirji_abdelghani/32/1604_2.png) [@Souirji\_Abdelghani](https://forum.getodk.org/u/Souirji_Abdelghani)\
**Post date:** [June 13, 2017, 8:48am UTC](https://forum.getodk.org/t/how-to-do-cascading-selects-in-odk-build/6707/11 "2017-06-13T08:48:17Z")

</div>

hi @Bidemi_Adejumo,

I had a look at your form. first you are not following XLSFORM syntax rules and second I do not see any cascading in your form.

I have attached for you the (formatted and edited) XLSFORM syntax document in pdf format that I had prepared for myself from XLSFORM website. My advice would be to patiently go, step by step, through it and do all the exercises (hyperlinks to the exercises are active in the document).

If you do this, be sure that you shall be 'operational' in a matter of days. For very difficult issues (rare), you'll find or ask for answers in this forum, or elsewhere in the Internet.

kind regards  
[XLSFORM tutorial\_edhani.zip](https://getodk.b-cdn.net/uploads/default/original/2X/9/90a5f5143f1017aa7e29484d6a208b95568c282d.zip) (847.1 KB)

---

<div class="post-metadata">

**Author:** ![Bidemi\_Adejumo](https://getodk.b-cdn.net/letter_avatar_proxy/v4/letter/b/3be4f8/32.png) [@Bidemi\_Adejumo](https://forum.getodk.org/u/Bidemi_Adejumo)\
**Post date:** [June 13, 2017, 12:57pm UTC](https://forum.getodk.org/t/how-to-do-cascading-selects-in-odk-build/6707/12 "2017-06-13T12:57:49Z")

</div>

Thanks so much. i quite appreciate you help. 🙏 🙏

---

<div class="post-metadata">

**Author:** ![yanokwa](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/yanokwa/32/1695_2.png) [@yanokwa](https://forum.getodk.org/u/yanokwa)\
**Post date:** [June 13, 2017, 4:25pm UTC](https://forum.getodk.org/t/how-to-do-cascading-selects-in-odk-build/6707/13 "2017-06-13T16:25:20Z")

</div>

Good news, folks! @issa is going to add cascading selects to the next release of Build. 🎉

You can track the progress at [https://github.com/opendatakit/build/issues/162](https://github.com/opendatakit/build/issues/162).

---

<div class="post-metadata">

**Author:** ![yanokwa](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/yanokwa/32/1695_2.png) [@yanokwa](https://forum.getodk.org/u/yanokwa)\
**Post date:** [October 30, 2017, 6:04pm UTC](https://forum.getodk.org/t/how-to-do-cascading-selects-in-odk-build/6707/14 "2017-10-30T18:04:40Z")

</div>

A post was split to a new topic: [Seeing a summary of the data sent by enumerators before aggregation](https://forum.getodk.org/t/seeing-a-summary-of-the-data-sent-by-enumerators-before-aggregation/10400)

---

<div class="post-metadata">

**Author:** ![Souirji\_Abdelghani](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/souirji_abdelghani/32/1604_2.png) [@Souirji\_Abdelghani](https://forum.getodk.org/u/Souirji_Abdelghani)\
**Post date:** [February 26, 2018, 1:44pm UTC](https://forum.getodk.org/t/how-to-do-cascading-selects-in-odk-build/6707/15 "2018-02-26T13:44:29Z")

</div>

Hi @yanokwa, hi @issa,

I am really happy that @issa has added cascading in ODK Build Offline. However, it is far from clear how it works. The information given in the Information Pane is very limited.

Do you have a working sample Build project with the cascading?

It would be nice to have a sample Build project with all the widgets, as we have it in XLSFORM.

Best.

---

<div class="post-metadata">

**Author:** ![kentchan4](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/kentchan4/32/3493_2.png) [@kentchan4](https://forum.getodk.org/u/kentchan4)\
**Post date:** [February 27, 2018, 8:05am UTC](https://forum.getodk.org/t/how-to-do-cascading-selects-in-odk-build/6707/16 "2018-02-27T08:05:27Z")

</div>

Hi @yanokwa,  
Like to know if I can have an option to let end user enter text if their selection is not on list?

I am working on enhancement on my current form by using cascading, but I found that some items may not available on selection (if) so counselor can input themselves.

Idea is I have 3 main questions ( 1.disturbance, 2. injury, 3. any friend / relatives dead) we are depending client how their response to their experience during the Crisis, some may want to talk about injury at beginning, some may talk about disturbance first.

I am thinking to use group selection on 3 main questions, then base on the 3 question cascade their corresponding sub-question, some question may pre-set answer, and counselor can input answer that not on list.

like this:

Response on:

1. Disturbance  
1a) Disturbance : No Food  
1a) Disturbance : High Tide  
1a) Disturbance : Other (manual enter)  
1b) Emotion : Sad  
1b) Emotion : Afraid  
1b) Emotion : Worry  
1b) Emotion : Other (manual enter)  
1c) SUD Level (decimal, manual enter)  
1d) How many days appear in the past 7 days : (Integer)  
1e) Symptom : ASD  
1e) Symptom : PD  
1e) Symptom : AD  
1e) Symptom : DD  
1e) Symptom : PTSD

2. Injury  
2a) Where is the injury : (manual enter)  
2b) Emotion : (manual enter)  
2c) SUD Level (decimal)

3. Dead  
3a) Who : Father  
3a) Who : Mother  
....  
3a) Who : Other (manual entry)  
3b) Emotion : Sad  
3b) Emotion : Frustrated  
...  
3b) Emotion : Other (manual entry)  
3c) Do you recall in the pass 7 days? (decimal)  
3d) Symptom : ASD  
...  
3d) Symptom : PTSD

Not sure if it can be done like above.  
Thank you!  
Kent

---

<div class="post-metadata">

**Author:** ![Souirji\_Abdelghani](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/souirji_abdelghani/32/1604_2.png) [@Souirji\_Abdelghani](https://forum.getodk.org/u/Souirji_Abdelghani)\
**Post date:** [February 27, 2018, 9:25am UTC](https://forum.getodk.org/t/how-to-do-cascading-selects-in-odk-build/6707/17 "2018-02-27T09:25:59Z")

</div>

Hi @kentchan4,  
You can:

1. add Other (value is 'other' for example) to the list of choices for your choicequestion of the Choose One widget.  
Follow-up Question select 'other' (We are still in the Choose One widget!)
2. add a text question widget with relevance : selected(/data/choicequestion, 'other')  
Label your text question something like Please specify other ...

I wanted to add a good example given by @yanokwa in this forum (Colors.odkbuild) but I couldn't find where and the website won't let me upload a file with a .odkbuild extension.  
Sorry!

I just found the link: [https://forum.getodk.org/t/help-on-odk-build-how-can-i-create-other-on-multiple-choices/6533](https://forum.getodk.org/t/help-on-odk-build-how-can-i-create-other-on-multiple-choices/6533)

---

<div class="post-metadata">

**Author:** ![Mamman](https://getodk.b-cdn.net/letter_avatar_proxy/v4/letter/m/a587f6/32.png) [@Mamman](https://forum.getodk.org/u/Mamman)\
**Post date:** [March 3, 2018, 11:02am UTC](https://forum.getodk.org/t/how-to-do-cascading-selects-in-odk-build/6707/19 "2018-03-03T11:02:31Z")

</div>

Hi Souirji  
Since I join the forum, I find interest in reading your post.please I need help concerning a form I build using Odk build.I am learning how to use the relevance column on Xls.when I saw your advice on building the form in build and then converting it to xls then apply the $ sign syntax to skip I jumped on it but it did not work.it is always given me error on that node when I try to validate.what do you think I should do?

---

<div class="post-metadata">

**Author:** ![Souirji\_Abdelghani](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/souirji_abdelghani/32/1604_2.png) [@Souirji\_Abdelghani](https://forum.getodk.org/u/Souirji_Abdelghani)\
**Post date:** [March 3, 2018, 2:19pm UTC](https://forum.getodk.org/t/how-to-do-cascading-selects-in-odk-build/6707/20 "2018-03-03T14:19:36Z")

</div>

Hi @Mamman, @issa, @yanokwa,

I was thrilled by the addition by @issa of cascading, and other nice things, to Build Offline. Therefore I have tested it and made a little tutorial which is attached [Build Offline-cascading select\_Souirji.pdf](https://getodk.b-cdn.net/uploads/default/original/2X/8/8470c5462b444bb8210b878773475ff46d60fb4c.pdf) (846.2 KB)  
[CascadingDemoGhani\_default.xlsx](https://getodk.b-cdn.net/uploads/default/original/2X/1/1d051036e3fae3ac9fc06fd600552bd366835233.xlsx) (15.1 KB)  
[CascadingDemoGhani\_default.xml](https://getodk.b-cdn.net/uploads/default/original/2X/e/ecbf505e5d3abb335697c2e98046e49787d3e3b6.xml) (6.9 KB).  
I would like to contribute the following remarks:

- Cascading works very well in Build Offline. Many thanks @issa!

- There's a little bug that produces a () under the column relevant which should not be there and prevents form validation, unless it is deleted;

- I find that it would be more logical to call the 'Choose One' widget a 'Select One' widget to be consistent with XLSForm terminology. Otherwise, why not call 'Select Multiple' 'Choose Multiple'?

- When there is no warning message, the worksheet warnings should not be created at all.  
.

---

<div class="post-metadata">

**Author:** ![Mamman](https://getodk.b-cdn.net/letter_avatar_proxy/v4/letter/m/a587f6/32.png) [@Mamman](https://forum.getodk.org/u/Mamman)\
**Post date:** [March 3, 2018, 2:51pm UTC](https://forum.getodk.org/t/how-to-do-cascading-selects-in-odk-build/6707/21 "2018-03-03T14:51:27Z")

</div>

Thank you for your help.I am grateful

[Next page](https://forum.getodk.org/t/how-to-do-cascading-selects-in-odk-build/6707.md?page=2)
