# Repeat as set of questions in ODK-X Survey

**URL:** <https://forum.odk-x.org/t/repeat-as-set-of-questions-in-odk-x-survey/1673>\
**Category:** Support\
**Tags:** odk-x-survey\
**Created:** [March 9, 2022, 12:29pm UTC](https://forum.odk-x.org/t/repeat-as-set-of-questions-in-odk-x-survey/1673 "2022-03-09T12:29:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Patrick\_Nyatindo](https://odkx.b-cdn.net/user_avatar/forum.odk-x.org/patrick_nyatindo/32/1027_2.png) [@Patrick\_Nyatindo](https://forum.odk-x.org/u/Patrick_Nyatindo)\
**Post date:** [March 9, 2022, 12:29pm UTC](https://forum.odk-x.org/t/repeat-as-set-of-questions-in-odk-x-survey/1673/1 "2022-03-09T12:29:49Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![elmps2018](https://odkx.b-cdn.net/user_avatar/forum.odk-x.org/elmps2018/32/105_2.png) [@elmps2018](https://forum.odk-x.org/u/elmps2018)\
**Post date:** [March 9, 2022, 2:12pm UTC](https://forum.odk-x.org/t/repeat-as-set-of-questions-in-odk-x-survey/1673/2 "2022-03-09T14:12:29Z")

</div>

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](https://docs.odk-x.org/xlsx-converter-reference/#queries)). The household member form in the example app links to this: [Sample Application Overview — ODK-X Docs](https://docs.odk-x.org/survey-sample-app-overview/). You can then use async\_assign (see: [Using ODK-X XLSX Converter — ODK-X Docs](https://docs.odk-x.org/xlsx-converter-using/#customizing-prompts)) 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](https://forum.odk-x.org/uploads/short-url/k8CAmdcawRA86VhPUqCcswRGZhx.xlsx) (457.5 KB)
