Creating questions based on selected_multiple and nested repeat_group

1. What is the issue? Please be detailed.
I trying to build a form that collects data using nested group_repeat and select_multiple questions however the form is misbehaving at a critical point.
The scenario is as follows:
I want to capture information on where and how many people have been affected by a specific event. Therefore I have an event group repeat that allows the user to input the number of events that affected the country in a specific year. Inside the event group repeat I want to have the information disaggregated by province and I am using a select_multiple question which allows the respondent to select the provinces that have been affected by the event. By selecting the provinces, the form generates a new group_repeat (inside the event group repeat) that is going to repeat the question to all the selected provinces. Afterward, I want to disaggregate the information for the districts inside the province. To do that I created a new group_repeat that is going to ask the questions based on the districts that belong to the current iteration (position/province). Everything seems to work very well when I select only one province. It allows me to select the districts and populate information for each district that was selected. However, if I select two provinces the form doesn't allow me to select the districts for the provinces I have selected.

2. What steps can we take to reproduce this issue?
If you want to reproduce the issue, run the form, select yes continue/"Sim Continue". Select a Year. input number of events (you can try with 1) in Quantos eventos de desastre afectaram Moçambique em 2001? question. Go down and select one province in Selecione as províncias que foram afectadas pelo evento question. [you should see the district list at the bottom of the form]. Select the districts in Selecione os districtos da província de Inhambane que foram afectados question and you will see how the form should work if it was working fine.
Now, go back to Selecione as provĂ­ncias que foram afectadas pelo evento and select an additional province, you will see that the Selecione os districtos da provĂ­ncia de Maputo que foram afectados question will no longer show the options.

3. What have you tried to fix the issue?
I have tried to play with selected-at function in the choice_filter but with no success. I am stuck and out of ideias.

4. Upload any forms or screenshots you can share publicly below.
Kobo Questionaire - SandBox.xlsx (58.5 KB)

  • Form is here

I am unable to submit screen shots as I am a new user.

I was able to fix the issue.
I added a line that gets the same information that is passed to the groups that identify the provinces.
type|name|calculation
calculate|selected_province|selected-at(${event_affected_admin_1},position(..)-1)

I have then used the information in selected_province to filter out the district of the selected provinces. and it worked.
Kobo Questionaire - SandBox.xlsx (58.4 KB)
See fixed form

Glad you figured out a solution!

Please make sure you're very careful to train your data collectors not to change the selection after they have started filling out the related repeat. What you've done with this form design is used the repeat index to look up a value in the select. If the values that are selected change, the values pulled into the repeats will change as well.

1 Like