Choice filters (Casacade)

Choice filters allow you to dynamically filter the options shown in a select_one or select_multiple question based on the answer to a previous question.

They are useful when you have linked dropdowns, such as showing cities based on the country selected, or filtering job titles based on department.

How choice filters work

To use a choice filter, follow these steps:

  1. In the survey sheet, add a column named choice_filter.

  2. In the choices sheet, add an extra column with the filtering attribute.

  3. The choice_filter expression in the survey sheet must match the filter value from the selected answer.

The syntax for the filter is:

filter_column = ${question_name}

This compares a column in the choices sheet to the value selected in a previous question.

Example: Country and city

survey sheet

type
name
label
choice_filter

select_one country

country

Select a country

select_one city

city

Select a city

country = ${country}

choices sheet

list_name
name
label
country

country

usa

United States

country

france

France

city

nyc

New York City

usa

city

la

Los Angeles

usa

city

paris

Paris

france

city

lyon

Lyon

france

What happens:

  1. The user selects a country in the first question (e.g. France).

  2. The second question (Select a city) only shows cities where the country column in the choices sheet matches the selected country (france in this case).

  3. So only "Paris" and "Lyon" will appear in the city dropdown.

Last updated

Was this helpful?