Magpi's new filtered (or "cascading") multiple choice feature allows you to use one multiple choice question to filter or limit the options in the next multiple choice question (note that the cascading question must directly follow the question with the filter).
A good example of its application would be in questions that require viewing of locations under main regions. For example, you might like to display a list of states in Sudan, where if any is selected, only the localities in that state would be displayed as options in the second question, and then only the area in that localities would be displayed as options in the third question:
To create a similar sets of questions, you'll need to create three multiple choice "radio button" questions. The first one will allow the user to select the "filter" (the choice that will narrow down the options in the second question). The second question's options will be filtered based on the answers to the first question.
You could also then add a third question, which would list of all the areas in the selected locality, using the second question as its filter.
So to have three questions that allow the choice of a state in Sudan, then a locality in that state, then the area in the locality, first we'll make the state question.
Question 1: the list of states
Figure 1: States in Sudan
The state question should be a regular multiple-choice question (the "cascading checkbox is NOT checked"). The next question will be a cascade question to filter the towns that belong to the listed states above.
Question 2: the list of localities for each state
To make the second question, which is filtered based on the answer to the first question, follow these steps
- Create a second radio button question.
- Check the Cascade checkbox on the question. This will display an extra column called the "Filter column".
- In the Filter column, enter the codes from the first question. For example, if you want localities in Sennar state to be identified, in the filter column you would type "Sennar", and in the label column you would type a locality in Sennar. Likewise, to allow localities in River Nile state to be identified, in the filter column you would type "River_Nile".
Important - the filter column is populated with the codes from the first question, not the labels. You would enter "River_Nile" not "River Nile" (see image above)
The image below shows Sennar and River Nile states, listing the localities/towns.
Figure 2: towns in Sennar state
Question 3: the list of villages/areas for each town/locality
You then want to display a third level, which should show the sub-areas or villages that are under each state’s towns/localities. This requires that the filter picks the option codes from the localities columns.
Figure 3: villages/areas in Sennar’s towns/localities.
This is how the questions should appear on mobile, following from the state, to the town/locality, to the villages/areas to be displayed.
Figure 4: Mobile app view of the cascades.
Note: the filtered multiple choice feature currently works only on Android on radio button questions, but not dropdown or checkbox questions. We will work to extend the functionality to other types of multiple choice questions.