Repeater
Repeat a group of elements for every item. Data and expressions in the DocStudio designer user guide.
What it is
A repeater repeats its children for every item of a list.
When to use it
Lists that are not tabular: a card per product, a paragraph per allergy, a block per visit. For rows and columns use a table.
Build one
- Provide sample data with a list, for example
{ "allergies": [ { "name": "Pollen" }, { "name": "Latex" } ] }. - Click Repeater in the toolbox.
- In the Data section set Source to the data path
allergies. A line shows how many rows the sample has. - Select the repeater and click Text. The text is inserted inside the repeater.
- Bind the text to the path
name. Inside a repeater paths start at the current item.
The empty state
In Layers a repeater has an Empty state region. Elements there are shown when the list is empty. Drop a text on it, for example "No allergies recorded".
Useful names inside
$index is the item position (from 0), $count is the number of items and $parent reaches the data outside the repeater.
Nest repeaters
A repeater inside a repeater reads a list of the outer item. $parent then climbs one level.
Limits
- The preview shows the first 50 rows. The output includes every row.
- The number of rows is limited by the engine (see Limits).
- A source that is not a list is a wrong-type problem and nothing is repeated.
To number items from 1, use a function call: add with $index and the fixed value 1.