Templates
A template is a file that defines the layout of a generated document. It contains placeholders — markers that the system replaces with real data when the document is produced.
Administrators upload templates and attach them to entity types. When a user generates a document from a record, the system fills the template’s placeholders with that record’s field values and returns a finished file.
| A template and a document type are different concepts. A document type is an entity type that defines a kind of record (its fields and behavior). A template is a file — with placeholders — that defines the layout of the output generated from that record. One entity type can have several templates; each can be enabled or disabled individually. |
|
What this page describes is the mechanism. The specific kinds — document types, fields, statuses — are defined for your organization; yours may differ. See the entity system. |
What templates do
Templates turn structured data into formatted output. Instead of copying values by hand into a contract, invoice, or report, you upload a template once and generate the finished file every time you need it.
A single template can produce:
-
a one-page invoice with a company logo,
-
a multi-page contract with a table of proposal line items,
-
a workbook that pulls in the current price catalog alongside the deal data,
-
a slide deck with one slide per display in a campaign.
Upload formats and output
Templates are uploaded as regular office files in one of three formats:
-
DOCX (Word) — contracts, invoices, letters, and any single-flow text document.
-
XLSX (Excel) — reports, price sheets, reconciliation workbooks, and any document that needs tabular calculations or multiple data sources.
-
PPTX (PowerPoint) — media kits, campaign summaries, and any document where each item occupies its own slide.
PDF is an output-only format — you cannot upload a PDF as a template. When generating a document, you choose whether to produce the output in the template’s native format or as a PDF converted from it.
How placeholders work
Every template contains placeholders written in a double-brace syntax: {{fieldName}}.
When the document is generated, each placeholder is replaced with the corresponding field value from the record.
Fields are referenced by their machine names, the identifiers defined in the entity type system.
For example, a field displayed as "Customer Name" might have the machine name customerName, so the placeholder is {{customerName}}.
Beyond simple value insertion, the placeholder system supports:
-
Repeating sections — a block that repeats once for each item in a collection, producing table rows, slides, or paragraphs.
-
Expression placeholders — inline JavaScript expressions that compute values, with formatting helpers for numbers, dates, and currency.
-
Image placeholders — shapes that are replaced with images stored in the record’s data.
-
Inverted sections — a block that renders only when a field is empty, acting as a fallback.
Each of these is covered in its own page below.
Templates bind to entity types
Templates are a platform capability, not limited to the Documents section. A template can be attached to any entity type — deals, counterparties, directory records, inventory items, or custom types defined by the administrator.
The entity type determines which fields are available as placeholders.
When you write {{contractNumber}} in a template attached to a contract entity type, the system resolves it from the contract record that triggers the generation.
Pages in this section
- Placeholders
-
The placeholder syntax — simple values, nested paths, root-context access, and inverted sections.
- Repeating sections
-
How to repeat table rows, slides, and paragraphs for each item in a collection.
- Expressions and formatting
-
Expression placeholders, the
fmt.number,fmt.date, andfmt.currencyhelpers, and auto-formatting behavior. - Image placeholders
-
Replacing shapes with images in DOCX, XLSX, and PPTX templates.
- Excel templates
-
XLSX-specific features — typed cell values, date auto-formatting, live formulas, DATEDIF, cell splitting, multi-sheet workbooks, and error resilience.
- The _data sheet
-
Pulling additional data sources into an XLSX workbook using the reserved
_datasheet. - Troubleshooting
-
What to check when generated output is blank, incomplete, or missing values.
Related pages
-
Exporting a record — the Export action and output formats
-
Batch reports — generating documents in bulk
-
Data types — the field types available in templates
-
Expressions — how computed fields work in the entity system
-
Entity types — defining entity types and their fields