Repeat as set of questions in ODK-X Survey

I have a set of questions that I need to repeat n times based on the number entered in the previous question. In ODK Collect this can be done using start repeat and end repeat together with repeat_count. I’m not sure how this can be implemented in ODK Collect.

Hi @Patrick_Nyatindo! Yes, you can do something similar. You would create a form and table for what you need to repeat, and then you can link it to the table with linked_table and queries (see: ODK-X XLSX Converter Reference — ODK-X Docs). The household member form in the example app links to this: Sample Application Overview — ODK-X Docs. You can then use async_assign (see: Using ODK-X XLSX Converter — ODK-X Docs) and count the number of forms into a variable and use a constraint on that, so it has to equal the number entered in the previous question. I am attaching a questionnaire where we did that. For instance in section 3_0_individual_data, we ask in row 6 (q300) how many members are in the household. Then there’s a sub-form to a linked table on line 18. In line 160 we calculate the number of forms and in line 166 we run a check that it is equal to q300 (# of members).
quest1_00_0.xlsx (457.5 KB)