Many templates have a need to present repeating data (eg multiple order lines for an order). Often the precise number of repeated answers will vary from data entry to data entry. You can add repeatable sets of fields to a Form by using a Page Group with the Repeatable property ticked on.
There are two ways to output the answers for these repeatable fields in your template:
- Repeat rows in a Word table or Excel worksheet using the special {{!REPEATROW}} placeholder
- Define the section of the template to output for each repeat.
This uses the special {{!REPEATSTART}} and {{!REPEATEND}} placeholders.
These options give you the flexibility to handle repeating data the way you want.
Using the Repeat Rows Approach
Often it is useful to place repeating data in a Word table or Excel worksheet.
You can create a repeatable listing by adding a special {{!REPEATROW}} placeholder into the very first cell of the row you want to repeat.
The system will then repeat the enclosing row and will replace all placeholders found within the relevant data values.
For example in a Word table, it might look like this:
FIRST NAME |
LAST NAME |
GENDER |
{{!REPEATROW}}{{firstname}} |
{{lastname}} |
{{gender}} |
Or, in an Excel worksheet, it might look like this:
FIRST NAME |
LAST NAME |
GENDER |
{{!REPEATROW}}{{firstname}} |
{{lastname}} |
{{gender}} |
Remember that you must place the REPEATROW placeholder as the very first item in the row!
Using the Repeating Sections Approach
With this option you define the placeholders once for the desired fields in a repeatable page group, and enclose these within special {{!REPEATSTART}} and {{!REPEATEND}} placeholders.
For Excel. the system will repeat all rows found between the START and END placeholders.
This tells the system to repeat everything found within the REPEAT placeholders, including formatting, bullet points, table rows, images, static text etc.
When generating output, the system will make a copy of the area within the REPEATs and will replace all regular data name placeholders found within the area, for each repeat of the answers.
For example, imagine we have a Form with a repeatable set of fields with data about children:
- First Name (data name=”firstname”)
- Last Name (data name=”lastname”)
- Gender (data name=”gender”)
You could define a repeatable bullet listing as follows:
Children
{{!REPEATSTART}}
Name: {{lastname}}, {{firstname}}
Gender: {{gender}}
{{!REPEATEND}}