A section is a way of grouping fields on a page in a smart online form. As each section is displayed once in the front end, the fields grouped within a section can be answered once only. A repeatable section is the same as a section in all ways except one - it can be displayed multiple times in the form's front end, meaning the fields within a repeatable section can be answered multiple times.
The use-case for repeatable sections is for inputting information for multiple versions of items within the same category. For example:
- collecting the name, DOB and email address of multiple people,
- the address and purchase price of multiple properties,
- the date of manufacture and mileage of multiple motor vehicles.
In all cases, the same information is collected multiple times.
The main benefit of using a repeatable section is that it is faster, simpler and more scalable to create one repeatable section instead of multiple sections. Additionally, when using a repeatable section you only need to make changes/edits once, rather than once for each section as is the case if you do not use a repeatable section.
Another benefit of repeatable sections is their usage with repeatable named ranges.
Setting a section as "Repeatable"
You can make a repeatable section by either creating a new section and setting it as "Repeatable" or by setting an existing section as "Repeatable". To mark a section as "Repeatable":
- add a new section by clicking "New Section" or navigate to an exisitng section and click the edit button,
- the edit panel will then open on the right where you can check "Repeatable",
- select the minimum and the maximum number of repetitions as required, and
-
click "Save".
In step 5, the minimum and the maximum number of repetitions can be a number (an integer) or a field value (the answer of a number field). The cap on the maximum number of repetitions is 100.
The {{Repeat}} variable
To distinguish between repetitions, you may use the {{Repeat}} variable (which is case sensitive) within your section headings, question labels and option labels. The {{Repeat}} variable acts as a repetition counter that identifies each repetition of a repeatable section. For example:
-
in the first instance "{{Repeat}}" is replaced with "1"
-
in the second instance "{{Repeat}}" is replaced with "2",
- and so on.
Referencing a repeatable field internally
When a repeatable field is used within its repeatable section, you can only refer to the version of the field that exists within the same repetition (e.g., in repetition #4, you can only refer to answers of fields also in repetition #4). There are no special instructions for these references, so you can treat internal references to a repeatable field as if they are not within a repeatable section.
For more information and some examples, click here.
Referencing a repeatable field externally
The fields within a repeatable section can also be referenced from outside that repeatable section. To do so, we use a composite reference. Depending on where in the form a composite reference is used, different field components are available.
To find out more about how to use repeatable fields:
Repeatable field components
All composite references are made up of two components:
- the field component that identifies the field,
- the repetition component that identifies the instance.
Repetition components are grouped into three categories:
- Specific instance,
- Any and All, and
Repeatable section properties
There are four properties of repeatable sections:
- the total number of repetitions instantiated;
- the number of the current repetition;
- the minimum number of repetitions that can be instantiated; and
- the maximum number of repetitions that can be instantiated.
To find out more about these properties and how to access them, please click here.