My goal is to have users select a district and loop through several questions about each health facility linked to the selected district. Districts and health facilities are pre-loaded in choices.
2. What steps can we take to reproduce this issue?
This form includes all 25 health facilities in the repeat.
I believe that my repeat_count needs to limit the count to where districtid=${district} but my current entry generates the total count of the list elements (not the filtered list).
count(instance('health_facility')/root/item)
@LN does anything come to mind for you about how to limit this count? I picked up on the general idea from your answer here. I'm trying to limit the repeats to elements of the health_facility list where districtid equals the selected district.
This first filters the list by district and then uses the repeat position to index into the resulting filtered list.
It's easy with these really dynamic forms to end up with something that's hard to analyze. Make sure to make some test submissions and have a good analysis plan! In particular, I would strongly recommend saving the health facility id in each repeat instance to join on.