When you enable a repeating section you can ask the same set of fields multiple times without having to know before the form is started by the fieldworker, exactly how many repeats you will need.



Take the following scenario as an example:


You need to visit multiple households and capture the name and age of each household member living there. The size of each household varies greatly and it is impossible to predict what the maximum number of household members in any household will be.  



You will need to add two things to your form:

  1. A numeric field where you will capture the number of repeats that you need. 
    • E.g. How many household members live in your household?
    • Add this field to any section above the section that needs repeating [this can be either an integer or a numeric variable field type].
    • You can also use an existing numeric field in a section above the section that needs repeating.
  2. The section (and fields) you want to repeat.
    • E.g. What is the name of the household member? and What is the age of the household member?
    • This whole section and all the fields added to this section will be repeated based on the response to your numeric field above. This means you only need to add each field once, and the repeating section will take care of the rest.


To make the section repeat, follow these steps:

  1. In the Design tab, find the section you want to repeat and click on the section's name to open the drop-down menu.
  2. From the drop-down, select 'Repeating properties'.
  3. Tick the checkbox next to 'Enable repeating for this section'. 
  4. From the drop-down, select the field that will determine how many times this section will be repeated.
  5. Select 'Save'.






Your repeating sections will be indicated on your form as shown below:





Alternatively, if it is not possible to know beforehand how many times the section needs to be repeated, you can set it up as explained here



Removing the repeat


To remove the repeating of a section:

  1. In the Design tab, find the section that has repeating properties enabled and click on the section's name to open the drop-down menu. From the drop-down, select 'Repeating properties'
  2. Deselect the checkbox next to 'Enable repeating for this section'.
  3. Select 'Save'.



Referring to the current repeat number 


If you want to keep track of which repeat a field is referring to, you can type __{INDEX}__ where you want the number to appear in your field.  Note:  '__' is a double underscore.


Example:


In your repeating section, add/change the field text to the following:

  • What is the name of household member __{INDEX}__?
  • What is the age of household member __{INDEX}__?




When using this form on your handset, the '__{INDEX}__' will be replaced by the repeat number. So the first time the set of fields is asked, it will be replaced by 1, the second time the set of fields is asked, it will be replaced by 2, etc.


This is what it will look like in the Design tab on the console once set up: