Data stored in tabular format in a Collection can be dynamically displayed in automatically generated documents. For data in this kind of format (e.g. a list of employees, each with name and position), it is the recommended way to create tables. For data in different formats, you can position placeholders manually.
Add a dynamic table to a document template
Follow the steps below to add a table to a document template that will display the data from a specific collection. The final row of the table will be duplicated as many times as required to accommodate the data in the collection. The data will be formatted and displayed accordingly in automatically generated documents.
- Insert a table into your document template and add relevant formatting.
- Add the tag {{\collection-table-row your_collection_name}} directly above the table and the tag {{\end-collection-table-row your_collection_name}} directly below the table (replace “your_collection_name” with the name of your collection).
- In the last row of the table, select the cell in which your data is to be displayed. Add the tag {{your_collection_name ==> your_collection_itemX}} to that cell. You only need to add the tag once as sufficient rows will be added to the bottom of the table to accommodate all the items in the collection.
This image illustrates the transition from template to self-service document. The placeholders in the template will be duplicated for as many times as needed to accommodate your Collection and replaced by text generated in response to end user answers. - Upload the template to a Create Document Action.
- Map all placeholders to their matching nodes, including the collection itself. This will happen automatically if nodes and placeholders share the same name.
Add a collection table to a cell in a table
You can insert your table inside a single table cell to build more complex document structures. The start and end tags must wrap the collections table in the cell.
Known limitations
Currently, bringing a collection into a document table only works for collections with more than one field. For example, if your collection only collects the names of employees, you cannot bring it to a document table. If it collects the names and the positions of employee, you can bring it to a document table.