Dependent Dropdowns
Last updated
Last updated
One of the most useful features of data validation is the ability to create a dropdown list that lets users select a value from a predefined list. Dropdown lists make it easy for users to enter only data that meets your requirements.
We are going to investigate this feature in-depth and learn how to create cascading drop-down lists that display choices depending on the value selected in the first dropdown.
While Epicollect5 does not provide dependent (or conditional) dropdown lists directly, their behaviour can be simulated using .
We built the example project for you to look at.
The source file can be found so anyone can import it to study its structure and tweak it to their liking.
The project is really simple. The users will pick a color out of red, green, or blue, and based on that answer they will be asked a new question about the color they picked.
The dependent dropdowns have all a jump set to "always" pointing to the last question (the README with some comments). This is to avoid the users to see the dependent dropdowns they are not interested in.
They are also set as required forcing the users to pick a possible answer from the list.
The approach shown here can be used with any multiple-choice question types like RADIO, CHECKBOX, and SEARCH.
A combination of is used to create a conditional flow. Based on the color selected, the users will "jump" to the related dropdown, which will show a list of possible answers related to that color only.
When looking at the data, the answers from the dependent dropdowns will be spread across separate columns, one per each dropdown. Those columns can easily be merged in the post-processing of data using Excel or similar tools.