The Document Generation step allows builders to generate documents from templates using workflow data. With Repeating Entities, you can use collection data in a generated document in two ways. On a dynamic DOCX template, the document repeats a table, list, or text block once for each record. On a static PDF overlay, one repeating property mapped into a flow field prints every value as a comma-separated list. The overlay layout does not repeat.
On a dynamic template, this is especially useful for scenarios like:
- Invoices with multiple line items
- Patient records with visit history
- Orders with multiple products
📖 Learn more: [How to create a Document Generation step]
Who Can Use This Feature
- Builders configure document templates, loop content controls, and field mappings
- Operators interact with generated documents but do not configure templates
- Admins and Managers can review document outputs through workflow execution logs
How It Works
Repeating data can be added from the Data Fields tab in the Document Builder. On a dynamic template, a collection displays as structured content: a table, list, or text block. On a static PDF overlay, one repeating property displays as a comma-separated list in a single flow field.
Print repeating values on a static PDF overlay
Dynamic documents repeat a section once for each record in a collection. A static PDF overlay cannot do that. The PDF layout is fixed.
If you need every value from one repeating property on a single line of a static PDF, drag that property into a static flow field. At generation time, Streamline prints the values as one comma-separated list.
This is useful when a regulated or state-approved PDF must stay in its original layout, and a dynamic template is not an option. For example, several policy numbers entered in a repeating section can print in one overlay field as POL-001, POL-002, POL-003.
Note: This applies only to static overlay documents. Dynamic documents still use repeating sections (table, list, or text block). Those sections are unchanged.
Who this is for. Builders map the repeating property onto the static overlay. Operators and admins see the finished document. They do not configure the mapping.
Add a repeating property to a static flow field
- Open the static overlay document in the Document Builder.
- Open the Data Fields tab on the left. This is the same panel used for other overlay data fields.
- Find the repeating property you want to print. Repeating data is grouped as a collection.
- Drag that property into the static flow field on the PDF.
- Publish the workflow.
When the workflow runs, the field prints every non-empty value in collection order, separated by a comma and a space. A single value prints alone, with no extra comma. Empty values in the collection are skipped, so the line does not contain a double comma or a trailing comma.
You do not need a Transform step to join the values first.
What you can do
- Map a repeating property onto a fixed PDF. The static flow field accepts the collection property. The mapping is saved when you publish.
-
Print the whole collection in one field. Three policy numbers print as
POL-001, POL-002, POL-003. - Skip blanks. If one row has no value, that row is left out of the string.
Feature considerations
- Comma only. The separator is a comma. You cannot choose a semicolon, tab, or other separator in this release.
- One field, not a repeating section. The overlay does not add a row, list item, or text block per record. Native PDF templates still do not support loops.
- Empty collection. If the collection has no rows, the field is empty. The document still generates, and no comma is printed.
- Dynamic documents are separate. Loop sections on a DOCX template still render one row, list item, or text block per record.
- Existing overlay mappings stay as they are. Fields mapped to a single (non-repeating) value are unchanged.
- Nested collections. You cannot filter a nested collection so that only the current parent row prints. That filtering is not part of this release.
Troubleshooting
| Issue | What to check |
|---|---|
| The repeating property cannot be dragged onto the PDF | Confirm you are in a static overlay document, and that you are dragging a property from the collection rather than the collection itself. |
| Only the first value prints | Confirm the field is a static flow field with the repeating property mapped directly. On a dynamic document, a field outside an active loop still prints only the first record. |
| The PDF shows a stray or double comma | Empty values should be skipped. If a blank row still prints a comma, capture the workflow and the field mapping. |
| You expected a table or a new line per record | That behavior is the dynamic document repeating section. A static overlay prints one comma-separated line. |
Adding Repeating Data to a Document
The steps below are for dynamic documents. They create a repeating table, list, or text block in a DOCX template.
- Open your document in the Document Builder.
- Navigate to the Data Fields tab on the left-hand panel.
-
Locate the collection you want to use.
- Repeating data is grouped into collections
- These fields are identified by an icon that looks like a circle with two arrows chasing each other, indicating the data will repeat
For example, if your workflow includes a collection of items with a category and description, you may see fields like:
- items.category
- items.description
- Drag a field from the collection into your document.
When you add a field from a collection:
- A repeating section is automatically created
- The builder groups related fields together based on the collection
- Only fields from the same collection can be included in that section
Configuring the Repeating Section
After adding a collection field, you’ll see options to customize how the data is displayed.
Continuing the example:
-
You can choose how to display the data:
- Table
- List
- Text block
If you select table:
- Each record in the collection becomes a row
- Category and Description are mapped to columns
You can then:
- Select the collection field to use
- Customize labels (e.g., “Category”, “Description”)
- Add additional fields from the same collection
Once finished, click Insert to add the repeating section to your document.
Result
- Each item in the collection is rendered dynamically
- The document expands based on the number of records
- In this example, category and description values are displayed for each item
- No manual duplication is required
Example of how this looks on the document
Additional Example: Invoice with Line Items
Consider a workflow generating an invoice with multiple products.
Collection data:
- Product A — $10
- Product B — $25
- Product C — $15
Template setup:
A loop content control wraps a table, with fields mapped to product name and price.
Rendered output:
| Product | Price |
|---|---|
| Product A | $10 |
| Product B | $25 |
| Product C | $15 |
Each row is dynamically generated based on the collection—no manual duplication is required.
What You Can Do
Render Dynamic Tables from Collections
Loop content controls can wrap an entire table in the DOCX template. During rendering:
- Header rows are preserved
- Data rows are repeated once per record in the collection
Each column is mapped to fields within the collection (e.g., SKU, price, quantity) using the builder’s field mapping panel.
Generate Lists from Collection Data
Loops can wrap bullet or numbered lists, producing one list item per collection record.
Each list item is populated using mapped fields, allowing structured representation of repeated values.
Render Repeating Text Blocks
Loop content controls can wrap paragraph-level content, generating a repeated text block for each record.
This is commonly used for:
- Visit summaries
- Case notes
- Record-specific descriptions
Field mappings resolve relative to the current record during each iteration.
Work with Nested Collections
Nested data is supported using separate loop content controls:
- An outer loop processes the parent collection
- An inner loop processes the child collection
The outer loop establishes the parent record context, allowing inner loops to resolve data relative to that record.
Handle Empty Collections Automatically
If a collection resolves to an empty array or invalid data:
- The loop body is omitted entirely
- No output is rendered for that section
This ensures clean document output without empty placeholders.
Use Multiple Collections in a Single Template
A single document template can include multiple loop content controls, each mapped to different collections.
All loops are processed during rendering, enabling multi-dataset document generation.
Resolve Collection References During Rendering
Before template merge, the document engine:
- Resolves collection references from workflow data
- Retrieves collection data from the File Upload Service
- Processes nested references recursively
This ensures all required data is available during loop execution.
Maintain Compatibility with Existing Templates
Existing templates and scalar (non-repeating) field mappings continue to function unchanged.
Loop content controls operate independently and do not interfere with standard field processing.
Feature Considerations
When a DOCX template is required
Loops (a repeated table, list, or text block) require a DOCX template configured in the OnlyOffice builder. A native PDF form still cannot loop.
PDF delivery of a looped document is supported by:
- Rendering the DOCX template with loop data
- Converting the result to PDF
On a static PDF overlay, you do not need a DOCX template to print repeating values. Map one repeating property into a flow field. That field prints every value as a comma-separated list. It does not repeat the layout.
Loop Scope and Nesting
Each loop content control can iterate over one collection only.
To render nested data:
- Use separate loop controls for each level
- Ensure inner loops reference data relative to the parent record
Fields referencing deeper levels than the loop scope may not render as expected.
Empty Collection Behavior
On a dynamic document, empty collections result in the loop section being fully hidden.
There is no built-in fallback message.
To display a message (e.g., “No items”), use a conditional content control.
Table Wrapping Requirements
Loop content controls must wrap the entire table element.
They cannot be applied to individual rows or cells.
Performance and Data Size
There are no enforced limits on collection size within the rendering engine.
However, performance depends on:
- Collection size
- Template complexity
- Available system resources
Data Source Requirements
Repeating Entities rely on collection-based data, typically provided via:
- Inbound Webhooks
- Data Search steps
- Other array-capable data sources
Collections must be available as valid references in the workflow context.
Troubleshooting Common Issues
| Issue | Resolution |
|---|---|
| Loop renders no data or section is missing | The collection may be empty, missing, or malformed. Empty collections are hidden by design. Verify that upstream steps provide valid collection data. |
| Table renders only the first row | A field inside the loop may not match the loop’s collection. Verify all field paths align with the configured loop. |
| Nested loop does not render correctly | Nested data requires separate loop controls. Ensure each loop targets the correct collection level. |
| Repeating data missing from PDF output | Loops (a repeated table, list, or text block) require a DOCX template. A native PDF form still cannot loop. On a static PDF overlay, you can map one repeating property into a flow field. That field prints every value as a comma-separated list. It does not repeat the layout. |
| Data appears as raw JSON or reference text | Collection references may not have resolved. Verify correct mapping keys and valid collection data. |
| Loop appears in builder but not in output | Ensure the loop content control fully wraps the intended element. |
| Incorrect or duplicated values in loop | Verify field mappings align with the loop’s collection and are not referencing external data. |
Compliance
This feature follows existing platform security and data handling practices:
- No additional data storage is introduced
- Collection data is processed in memory during rendering
- Generated documents follow existing retention policies
- Existing access controls apply to templates and outputs
Comments
0 comments
Article is closed for comments.