This article explains how to narrow down the list of possible answers based on other dropdown or flexible dropdown questions from the response form or based on User Profile fields.
Prerequisites
|
How does filtering work?
Sometimes, when building the response form, Dropdown or Flexible dropdown questions might require to filter one another to narrow down the possible answers for the end-users. In order to filter questions, all the possible answers must be linked to the same data source and be set up as reference schema fields. A Dropdown or Flexible dropdown question can be filtered by more than one field if they are related to one another.
How to filter a dropdown or flexible dropdown
Filtering a Dropdown or Flexible dropdown question can be done following the steps below:
- In Template Designer, open the Form tab.
- Click + Add question.
- In the Type field select Dropdown or Flexible dropdown.
- In Question title type the question. This is the question that will be displayed to the end-user.
- Select the Data source containing the list of answers necessary for the question.
- Select the Label column of the data source that should be displayed to end-users when answering the question.
- Click on Filter options.
Note
- This section will only be displayed if the dropdown is eligible for filtering.
- Filter options are only available to Dropdown and Flexible dropdown questions. Data connector questions cannot be filtered.
- Click + Add filter.
- Select the form field or User Profile field that should be used as a filter.
- Repeat steps 8 and 9 to add additional filters if necessary.
- Click Add to form (or click Save if you edited an existing question).
NoteIf there is only one answer left in the final filtered dropdown, it is possible to hide the question from the response form as no additional interaction is required by the end-user. |
Important
|
Examples
Example using a single filter
In this example the Products data source is used. The Category column has a reference to the Categories data source:
The data sources contain the values below:
- On the Form tab create a Dropdown with the Question title 'Category'.
- Link the field to the Name column of the Categories data source and select 'Fruits' as default value. The result looks like this:
- Click Add to form.
- Create a second Dropdown with the Question title 'Product'.
- Link the field to the Name column of the Products data source.
- Click + Add filter. In the Filter by field select 'Category'.
Note
It can occur that the Filter by field shows multiple fields with the same name.
Make sure to select the correct field, in this case the 'Category' Form field and not the User Profile field:
- The result looks like this:
- Click Add to form.
- The Form tab now shows the questions that have been created. Click Preview form to see how the questions will appear to the end-user:
- By default 'Fruits' is selected as Category. So the Product dropdown only shows fruits. When the category is changed to 'Vegetables', then the Product dropdown only shows vegetables:
Note
When no category is selected (the field can be cleared by clicking the x), then the Product dropdown will show both fruits and vegetables.
Example using multiple filters
In this example the same Products data source is used as in the previous example, but with an additional reference. The Category column has a reference to the Categories data source and the Origin column has a reference to the DomesticImport data source:
The data sources contain the values below:
- On the Form tab create a Dropdown with the Question title 'Category'.
- Link the field to the Name column of the Categories data source. The result looks like this:
- Click Add to form.
- Create a second Dropdown with the Question title 'Origin'.
- Link the field to the Name column of the DomesticImport data source. The result looks like this:
- Click Add to form.
- Create a third Dropdown with the Question title 'Product'.
- Link the field to the Name column of the Products data source.
- Click + Add filter. In the Filter by field select 'Category'.
- Click + Add filter again to add a second filter. In the Filter by field select 'Origin'. The result looks like this:
- Click Add to form.
- The Form tab now shows the questions that have been created:
- Click Preview form to see how the questions will appear to the end-user:
Depending on the selected category and/or origin these are the results:
Category Origin Product Empty Empty All products Empty Domestic All domestic products Empty Import All import products Fruits Empty All fruits Fruits Domestic All domestic fruits Fruits Import All import fruits Vegetables Empty All vegetables Vegetables Domestic All domestic vegetables Vegetables Import All import vegetables
Comments
Article is closed for comments.