SurveyLoopr
Tips & Tricks
5 min read

How to Add Cascading Selects in XLSForm

Mehrab Ali
Mehrab AliPublished June 12, 2026

Cascading selects in XLSForm use the choice_filter column to narrow one select question's options based on a previous answer — pick a region, see only that region's districts; pick a district, see only its villages. The filtering happens on the choices sheet with one extra column per level.

This is the standard pattern for location hierarchies, but it works for anything nested: crop → variety, facility type → service, brand → model.

Step 1: Tag child options on the choices sheet

Add a column to the choices sheet that records each option's parent. Here, every district carries the name of its region:

list_namenamelabelregion
regionnorthNorth
regionsouthSouth
districtkurigramKurigramnorth
districtrangpurRangpurnorth
districtkhulnaKhulnasouth
districtjessoreJessoresouth
surveychoicessettings
Warning:

Filter values must match the parent's name column, not its label. Tagging districts with "North" (the label) instead of "north" (the name) produces an empty second list — the most common cascading-select bug.

Step 2: Filter with choice_filter on the survey sheet

typenamelabelchoice_filter
select_one regionregionSelect your region
select_one districtdistrictSelect your districtregion=${region}
surveychoicessettings

The expression region=${region} reads: show only choice rows whose region column equals the answer to the region question. Note that the survey sheet uses a single =, exactly like other XLSForm expressions.

Step 3: Chain a third level

Each additional level repeats the pattern — a new tag column on choices, a new filter on the survey sheet:

typenamelabelchoice_filter
select_one villagevillageSelect your villagedistrict=${district}
surveychoicessettings

You can also combine conditions: region=${region} and district=${district} keeps a deep list unambiguous when village names repeat across districts.

Large location lists? Use an external CSV

A national village list can run to tens of thousands of rows, which bloats the form and slows loading. Past a few thousand options, switch from the choices sheet to select_one_from_file villages.csv with the same filter logic — the CSV attaches to the form on your ODK Central server and updates without republishing.

Tip:

Building a multi-level location cascade by hand means hand-tagging thousands of rows. LooprAI generates the full cascade — choices sheet, filters, and all — from a plain-language description or a pasted location list, free to start.

Build my first form free

Next: XLSForm skip logic →

Frequently Asked Questions

What is a cascading select in XLSForm?

A cascading select is a chain of select questions where each answer filters the next question's options — region narrows districts, district narrows villages. It is built with a tag column on the choices sheet and a choice_filter expression on the survey sheet.

How does choice_filter work in XLSForm?

The choice_filter column holds an expression like region=${region}, evaluated against the choices sheet. Only choice rows whose tag column matches the earlier answer are shown. The comparison uses choice names, not labels, and a single equals sign.

Why is my cascading select showing an empty list?

Usually because the filter column on the choices sheet contains labels instead of names, or the values don't match exactly. Verify each child option is tagged with the parent's name value, character-for-character and case-sensitive.

Can I have three or more levels in a cascading select?

Yes. Each level adds one tag column on the choices sheet and one choice_filter on the survey sheet, such as district=${district} for villages. You can combine conditions with 'and' when option names repeat across branches.

How do I handle thousands of options in a cascading select?

Use select_one_from_file with an external CSV instead of the choices sheet. The CSV is attached to the form on the server, supports the same choice_filter logic, keeps the form fast, and can be updated without republishing the form.

Do cascading selects work offline in ODK Collect?

Yes. The full choice list and filter logic are stored on the device when the form is downloaded, so cascades work with no connection. External CSV choice files are downloaded with the form and also work fully offline.

No Credit Card Required

Build the form first. Add hosting when you need it.

Start free with LooprAI, then deploy a managed ODK Central server or run DataSnap checks when your project is ready.

Automation handles the mechanical work.

Researchers decide what the evidence means.