Bij veel templates heb je Repeatable data nodig. Het aantal antwoorden dat je wilt afdrukken kan bij ieder afdruk anders zijn. Je kunt op in de apps ‘repeatable’ aanvinken bij pagina’s of tabellen gebruiken. Er zijn twee manieren om de gegevens voor de repeatable data te tonen met het template:
- Rijen herhalen in een Word tabel of Excel worksheet dooor de speciale {{!REPEATROW}} placeholder te gebruiken.
- Secties herhalen: een sectie maken op de template voor ieder te herhalen stuk. Gebruik hiervoor de speciale {{!REPEATSTART}} en {{!REPEATEND}} placeholders.
Hiermee heb je de flexibiliteit die je zoekt voor het gebruik van herhalende gegevens.
Het gebruik van Repeat Rijen Is vaak handig om gegevens in een Word tabel of Excel sheet te zetten. Je kan een lijst maken door de {{!REPEATROW}} placeholder in de eerste cell van een te herhalen rij te plaatsen. Het systeem zal de hele rij dan herhalen voor alle ingevoerde data. Bijvoorbeeld in een Word tabel:
FIRST NAME | LAST NAME | GENDER |
{{!REPEATROW}}{{firstname}} | {{lastname}} | {{gender}} |
Een Excel sheet kan er als volgt uitzien:
LAST NAME | GENDER | |
{{!REPEATROW}} | {{lastname}} | {{gender}}
|
Vergeet niet de {{!REPEATROW}} placeholder als eerste item in de rij te gebruiken!
Advanced: Meerdere gegevens herhalen per rij Soms is het handig gegevens naast elkaar te tonen in een rij, bijvoorbeeld bij foto’s die je in 2 of 3 kolommen wilt plaatsen. Je kunt dat instellen door achter REPEATROW het ‘sluis’-teken | en het aantal kolommen te zetten.
Bijvoorbeeld voor 3 kolommen gebruik je: {{!REPEATROW|3}}
In een Word tabel:
{{!REPEATROW|3}}{{photo}} |
{{photo}} |
{{photo}} |
Op een Excel sheet:
{{!REPEATROW|3}} |
{{photo}} |
{{photo}} |
{{photo}} |
Het herhalen van secties
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 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: {{!REPEATSTART}} Name: {{lastname}}, {{firstname}} Gender: {{gender}} {{!REPEATEND}} Important Note: Both {{!REPEATSTART}} and {{!REPEATEND}} placeholders must exist on their own rows respectively. Advanced Use: Outputting 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 2 or 3 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, specifically you must put a pipe character followed by the number of repeats to handle per row. So for example if you want to have 3 sets of repeated values side by side, then you would use: {{!REPEATSTART|3}} 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 in a Word document: Photos {{!REPEATSTART|3}}
Photo Name: {{photoName}} |
Photo Name: {{photoName}} | Photo Name: {{photoName}} |
{{photo}} | {{photo}} | {{photo}} |
{{photoCaption}} |
{{photoCaption}} |
{{photoCaption}} |
{{!REPEATEND}} An Excel worksheet may look like:
{{!REPEATSTART|3}}
|
||
Photo Name: {{photoName}} |
Photo Name: {{photoName}} | Photo Name: {{photoName}} |
{{photo}} | {{photo}} | {{photo}} |
{{photoCaption}} |
{{photoCaption}} |
{{photoCaption}} |
{{!REPEATEND}}
|
Nested Repeats Unfortunately we don’t currently support nested repeats within the template engine. When nested repeats are required, the best option would be to collapse the sections to be repeated. As an example, assume you have a list of buildings, that contain multiple rooms, and these rooms contain multiple items. You could have a repeating page, or a page within a table where the user can choose a building, then a room, and then an item, from three choice fields in the page. The form could use the PRIOR() formula to set the building and room values dynamically to save a user’s time by carrying forward the values from one page to the following page. We do have plans to include nested repeats within the template engine, but do not yet have a time-frame for when this feature will be implemented.