After capturing repeatable data, you might want to customize how it displays in a PDF output using Word or Excel templates.
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 allow you to handle repeating data the way you want.
While there are many flexible ways to handle repeating data, please note that nesting REPEATSTART/REPEATEND syntax is not supported — that is, you cannot place a REPEATSTART inside another REPEATSTART.
If you need to hide content dynamically, the correct approach is to use Hiding Sections/Rows in Custom Templates.
For downloadable examples of repeatable data templates, jump to the end of this article.
Repeating Rows
Often, it is helpful 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 first cell of the row you want to repeat.
The system will then repeat the enclosing row and replace all placeholders within the relevant data values, for example:
Word – Table
| First Name | Last Name | Gender |
|---|---|---|
| {{!REPEATROW}}{{firstname}} | {{lastname}} | {{gender}} |
Excel – Sheet
| 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!
Multiple Repeats per Row
It may be helpful to show repeat values side by side in the same row – for example, if you have a repeating photo capture page, you might want to put the photos side by side in a two or three-column configuration.
This is possible by adding some special syntax to the {{!REPEATROW}} placeholder: You must put a pipe character followed by the number of repeats to handle per row.
So, for example, if you want to have three sets of repeated values side by side, then you would use the following:
Then in the repeated row part of your template, you must specify the desired repeat fields as many times as the number of sets to display.
When generated, the answer value from each repeat will be inserted sequentially for each occurrence of the same dataname in the row, for example:
Word – Table
{{!REPEATROW|3}}{{photo}} | {{photo}} | {{photo}} |
Excel – Sheet
{{!REPEATROW|3}} | {{photo}} | {{photo}} | {{photo}} |
Repeating Sections
With this option, you define the placeholders once for the desired fields in a repeatable page group and enclose these within unique {{!REPEATSTART}} and {{!REPEATEND}} placeholders.
The system will repeat all rows between the START and END placeholders for Excel.
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 copies the area within the REPEATs and replaces all regular data name placeholders within the area for each repeat of the answers.
For example, imagine we have a Form with a repeatable set of fields for capturing children:
- First Name (data name=”firstname”)
- Last Name (data name=”lastname”)
- Gender (data name=”gender”)
You could define a repeatable bullet listing as follows:
Both {{!REPEATSTART}} and {{!REPEATEND}} placeholders must exist on their own rows, respectively.
Repeating Sections – JSON
Output JSON-formatted text through a JSON template using the syntax below to iterate through repeating sections of data:
This syntax can be used when outputting data for a JSON template or when communicating with JSON REST APIs. The syntax is the same.
Repeating Sections – XML
Output XML-formatted text through an XML template using the syntax below to iterate through repeating sections of data:
Multiple Repeats per Section
At times, it may be useful to show repeat values side by side in the same section. For example, if you have a repeating photo capture page, you might want to put the photos side by side in a two—or three-column configuration, with accompanying captions and other repeated data shown above or underneath each photo.
This is possible by adding some special syntax to the {{!REPEATSTART}} placeholder: You must put a pipe character followed by the number of repeats to handle per row.
So, for example, if you want to have three sets of repeated values side by side, then you would use the following:
Then, in the repeated section part of your template, you must specify the desired repeat fields as many times as the number of sets to display.
When generated, the answer value from each repeat will be inserted sequentially for each occurrence of the same dataname in the section, for example:
Word – Page & Table
Photos
{{!REPEATSTART|3}}
Photo Name:{{photoName}} | Photo Name: {{photoName}} | Photo Name: {{photoName}} |
{{photo}} | {{photo}} | {{photo}} |
{{photoCaption}} | {{photoCaption}} | {{photoCaption}} |
{{!REPEATEND}}
Excel – Sheet
{{REPEATSTART|3}} | ||
Photo Name:{{photoName}} | Photo Name:{{photoName}} | Photo Name:{{photoName}} |
{{photo}} | {{photo}} | {{photo}} |
{{photoName}} | {{photoName}} | {{photoName}} |
{{REPEATEND}} |
Examples
Attached are a form design and data output templates for Word and Excel to help you understand how the above functionality works.
- Download these attachments, then create a new form for your account.
- Go to the Designer page of your new Form, and use the “Import Fields” button to import the Form .xlsx file.
This will import the testing form design. After importing the fields, you should set the Form to Test mode. - Then go to the Settings page of your new Form, and upload the attached Template .xlsx and docx files into the Excel and Word Default Template fields, respectively.
- Now open the Form on your device and capture an entry. When prompted, make sure you capture more than one photo.
Complete the entry and upload it from your app. - Finally, go to the Data page of the secure website and find your entry.
Mouse over the entry row and click the Export link. Then, choose one of the Template files to download the output.