All Collections
Document generation and mail merge
How to group data when generating a document
How to group data when generating a document

Use the forms configurations to group your data in just one document

Vitor Mazon avatar
Written by Vitor Mazon
Updated over a week ago

When generating a document using Sheetgo you will use our smart tags system to specify which data from the spreadsheet will populate each part of the document template. You can take this even further by combining the header configuration from the forms to create groups of data that need to populate specific parts of a document. With this feature, users have granular control over how data is grouped and presented in the final document.

To use this functionality you need to place the configuration "[default: random]" or "[default: incremental]" on the header of your spreadsheet. When you use the form to submit new data to the spreadsheet these configurations will group the data that was submitted together, having just one ID for different rows inside the same submission.

You can learn more about the grouped configuration on forms here

In the example above we have an invoice spreadsheet that is populated using the form. In it, we use the [default: random] to generate one unique ID for each time the form is submitted. We want rows with the same ID to populate one single document instead of generating a different document for each row.

Now we need to add new special smart tags to the templated document: {{!group-start}} to mark the beginning of grouped data and {{!group-end}} to denote its conclusion. When using these smart tags Sheetgo will recognize that it needs to follow the IDs from the [deafult: random] configuration and group the rows that have the same ID.

Following from the invoice spreadsheet we will use the smart tags to group the data from the spreadsheet inside a table, where each row will reference the data from a row inside the spreadsheet on the same ID.

The final result will look like this each row that had the same ID has been added to the table inside the same document.

Need more help?

Contact us via chat, on our email ([email protected]), or send us a ticket!

Visit our Community for help, tips, tricks, and feedback for Sheetgo.

Did this answer your question?