One document from many records
Normally each record you select gets its own document. A template can instead make one document from all the selected records: a statement listing this month’s invoices, a run of letters in one PDF to print, or a sheet of name badges and QR-code labels.
A combined document counts as one document toward your allowance, however many records go into it.
Choose what a template makes
Section titled “Choose what a template makes”- Open the Template tab and select your template.
- Under General → Records per document, choose:
- One document per record: the default, one file per selected record.
- One document listing all records: a list, report or statement. The template repeats a row (or a block) for each record.
- One document, a page per record: the whole template once per record, in one file. Untick Start each record on a new page to run records on one after another, for slips and receipts.
- Labels: several records per page: the template is one label; the records fill a grid on the sheet.
- Click Save Settings.
The Generate button then says what it makes (Generate list, Generate one document or Generate labels) and shows how many records are selected.
Which records, in what order
Section titled “Which records, in what order”- Selected records: tick the records in a Grid view, then click Generate. They go into the document in the order the view shows them, not the order you ticked them.
- Every record in the view: click Use all records in this view in the Records card, then Generate. Filter or sort the view first to choose the records and their order.
One document takes at most 500 records, and a very large template fits fewer: AutomaDoc then refuses the document and says how many records fit. Above the limit nothing is generated; filter the view or select fewer records.
Writing a list template
Section titled “Writing a list template”In a list template the records are a loop called Records. Put a record’s fields between {#Records} and {/Records}, usually in one table row:
| # | Customer | Amount |
|---|---|---|
{#Records}{$num} |
{Customer} |
{Amount}{/Records} |
Inside the loop every field works exactly as in a one-record template: linked fields, nested loops, filters, and pictures by Alt Text. Outside the loop, use values about the whole document:
| Placeholder | Prints |
|---|---|
{RecordCount} |
how many records are in the document |
{Date} |
today’s date, in the template’s timezone ({Date | customDate:"DD MMM YYYY"} to format it) |
{Records | count} |
the number of rows, after any filter |
{Records | sum:"Amount"} |
a total of one field over all records |
The loop takes the usual filters: {#Records | where:"Status == 'Paid'" | sort:"Amount":"desc"}. A sort in the template wins over the view’s order.
Auto Generate builds a list template for you: pick the columns, put them in order, and tick Total on the number fields that should be added up.
A page per record
Section titled “A page per record”The whole template is filled once for each record, one after another in the same file, each starting on a new page (or running on, if you unticked the option). Write the template exactly as you would for one record.
Headers and footers are shared by every record of the document. A record’s field placed in a header or footer is left blank, with a warning, so put record fields in the body. {RecordCount}, {Date} and page numbers work in headers and footers as usual. Numbered lists restart in every record.
Labels
Section titled “Labels”The template is one label. Make the page small in your head: a few lines, a picture or a QR code ({QR:SKU} as the picture’s Alt Text). The records then fill a grid on the label sheet, left to right and top to bottom, as many sheets as needed.
Choose the sheet under Label sheet:
- A4 · 3 × 8, A4 · 3 × 7, A4 · 2 × 7, Letter · 3 × 10 and Letter · 2 × 5 match the common label stocks of that grid.
- Custom size lets you enter the page size, how many labels across and down, the margins and the gaps between labels, in millimetres. The extension shows the size each label comes out at.
The label size is what the page leaves after margins and gaps, so a sheet that does not fit is refused before you save. Content larger than a label is cut off at its edge. Labels print no header or footer.
Save to Base, status and webhooks
Section titled “Save to Base, status and webhooks”- Save to Base writes the one file to every record that went into it, following the template’s replace or append setting.
- The status field of every record is updated.
- The webhook callback receives the first record’s fields, plus
RecordCount.
The output filename pattern reads the first record, plus {RecordCount} and {Date}: Statement {Date} ({RecordCount} invoices).
From an automation
Section titled “From an automation”The HTTP trigger of a combined template takes several records: ?recordIds=rec1,rec2,rec3, or a JSON body {"recordIds": ["rec1", "rec2"]}. A single ?recordId= still works. A template that makes one document per record takes one record per call.
The document API does the same with JSON: a list in data makes one document, each item a record.
Good to know
Section titled “Good to know”- Approval templates always make one document per request.
- Very large documents with many pictures take longer to convert to PDF. If a document fails, try fewer records at a time.
- Word templates only: Excel and PowerPoint templates make one document per record.
- A combined document cannot be sent for signature: a signature request is about one record. Keep a separate one-record-per-document template for contracts.