/ Search

Search Epistola

Find documentation, integration guides, tour steps, blog posts and pages.

DocsIntegrationsTourBlogPage
↑↓↵esc

Repeat data as a list or table

Choose a Data List, Data Table, or Loop and bind each repeated item to template data.

Choose the result you need

Result Block Example
One list entry per value Data List Attachments to a decision letter
One table row per object Data Table Invoice lines with description, quantity, and amount
Several blocks per object Loop A heading and address for each recipient
A fixed grid you author cell by cell Table A short fixed comparison

You need Content Author access. First define the list and examples on the Data contract tab and save them. Only then configure the block.

List attachments

  1. Add optional attachments as a List with item type Text. Create an example containing Application form and Supporting statement.
  2. Choose Save and Done editing, then open the variant in the editor.
  3. Add a Data List. Set Data Source to attachments and keep Item Variable as item.
  4. Add a Text block inside its item template. Through {{, insert the expression item.
  5. Choose the List Type: Bulleted for unordered attachments, Numbered when their sequence matters.
  6. Preview. Two input items should produce two list entries.

Render rows from objects

In the contract, add items as a List with item type Object. Add child fields description (Text), quantity (Integer), and amount (Number). Add an example with at least two objects, then choose Save and Done editing.

{
  "items": [
    { "description": "Application fee", "quantity": 1, "amount": 25.5 },
    { "description": "Document copies", "quantity": 2, "amount": 5 }
  ]
}
  1. Add a Data Table with three columns.
  2. Set Data Expression to items; keep Item Alias as item and Show Header on.
  3. Select each column body and set Header and Width: Description 60, Quantity 15, Amount 25.
  4. Add a Text block inside each column body. Insert item.description, item.quantity, or item.amount through the expression builder.
  5. Format the amount with $formatLocaleNumber(item.amount, "#,##0.00") when two decimals are required.
  6. Preview. Each object should create one row. The widths set how wide the columns are compared to each other.

Repeat a group of blocks

If each record needs its own heading, paragraph, or other group of blocks, use a Loop. Set its Expression to the array and keep or change its Item Alias. Put the blocks that should repeat inside its body. Use paths such as item.name there.

The item alias exists inside the repeated content. Use the template’s normal field paths outside it.

Check boundary cases

Preview an empty list, one entry, and enough entries to cross a page boundary. If an empty list would leave a heading with nothing under it, hide that heading separately with a condition. If tables or pages break badly, see Layout and resource problems.

Epistola is open source, not free of cost. The organisations that use it fund its development, through Epistola or an Official Partner. We are steward-owned: fair prices, no profit maximisation. How Epistola is funded →