Repeat questions depending upon selection?

This is possible but requires a little knowledge of XML and XPath as far as I know!

Here is a sample form showing one approach. Note that I had to look at the XML to figure out how to get the district count and the district name. I added a notes column to try to explain the details. You should be able to start from this and add any questions you need in the district_questions repeat. Note also that repeat-over-filtered-choices is the filename I used which then becomes the document root. If you change the XLSX filename, you'll need to replace the name in the calculations as well.

If anyone knows of a more straightforward way to achieve the same thing I'd be very interested in seeing it! This is a really useful pattern so perhaps we could think of way for XLSForm to make this friendlier if it doesn't already exist.

2 Likes