Summary
What is a Qargo template?
Customisable, reusable blueprint for generating business documents such as invoices, delivery notes, loading sheets, quotes, etc.
Can be used in tasks to automatically generate and/or send documentation.
Why use templates?
Templates allow users to define how documents look and what data is included.
Allows each company to generate documents in a preferred format, tailored to the company workflow, language and branding.
Ensures all required data is dynamically filled in from TMS.
How are templates used?
Used to create documents associated to orders and trips.
Paired with workflow tasks, documents can be generated seamlessly, at the appropriate time.
Automatically generated reducing data entry errors and paired with contact tasks, introduces more workflow efficiency; ie: sending email POD / Invoice, etc.
Example: 'Generate document' tasks
3 core components:
Handlebars template: dynamic placeholders to insert data
Template schema: structured definition of all dynamic fields available in the template, and can include lists, tables, text, etc...
Data model: actual data passed to template when generated (ie: order value)
Fields in template schema define which dynamic data elements can be pulled in and shown, or repeated.
Can have simple fields, ie: 'title' or more complex ones for lists and tables that require parameters to be used.
Templates can be configured by editing schemas and visual layouts
Select which fields to show and define logic (ie: if/else, conditions, etc)
Document generation: template pulls latest data and fills out the dynamic fields according to template schema & data model.
Output is a ready to use document in desired format (ie: pdf, csv)
Templates can be global or tenant-specific
Global template = base layout that the tenant can override or extend with own variables
Tenant template = tailored for special requirements, ie: meeting legal / regulatory needs.
Supported features in templates:
Multi-language support (localisation) - when enabled for the tenant
Tables & context-specific loops
Custom helpers (like formatting dates, barcodes, etc)
Handling of special cases and conditionals, ie: if field is empty do not show
Attachments or images, ie: signatures
Handlebars expressions allow for advanced logic
Templates can be duplicated, edited, exported or copied between tenants for a streamlined setup.
Terminology
Qargo Template: Standard, global template versions provided and maintained by Qargo; act as reference library; easy to adapt as needed for branding, language, special data requirements, etc.
Tenant Template: Customised template specific to the tenant (account)
External Template: document templates available to be used or referenced from an outside source; can include shared templates across multiple organisations or locations, industry standard formats, templates imported from external systems; ie: credit notes, selfbills, trip sheets, CMRs.
Base Template: Generic template that is used to create a new document template; selected from a drop down of pre-determined options, based on category of document being created, ie: 'invoice'.
Archived Template: Templates that are no longer supported in the platform; typically replaced with an updated version.
Handlebars expression: Handlebars expressions are special placeholders and logic blocks used in templates to insert data and add conditional or repeating logic when generating documents or emails.
Context tag (Blue): Shown against particular fields / rows in the template editor; used to indicate particular field is tied to a specific part of underlying data, ie: stops which then show as a row per stop.
Understanding Template layout
When adding a new template, it is first necessary to select a base template. Once selected, the data rows and preview panel (#3 Visualise) are shown. The template will show with generic data.
From the NEW TEMPLATE page, select the appropriate 'Base template' from the drop down list.
CONFIGURE the new template. Give the new template a name that makes the use case easily identified. Modify any fields to customise the template, or use the base template as is.
VISUALISE the template format in the preview panel. Clicking on an element in the preview panel will highlight the corresponding data row. Click into the row if changes to the displayed data are required.
Edit the template data by clicking into the appropriate row and edit content.
Click into the row or use the 'eye' icon, will highlight the data set from this row in the preview panel.
Click information in the preview panel will highlight the appropriate row where the data set can be edited.
Use the 'Data owner' field to view live data; options displayed are related specifically to the document. In the example below for instance, it's a billing proposal, so the options shown in the data owner field will be purchase invoices.
Understanding Edit icons
Clicking into a row to edit details will display a selection of edit options.
Text editing options, including bold, italic and underline; font size and colour; H & h will create the data as Heading 1 (H) or Heading 2 (h).
Add a url link to a website. A pop-up window will display where this can be added.
Add data as bullet points or numerical ordering.
Syntax blocks for creating more advanced conditions using expressions that incorporate multiple variables or conditions.
Formatting options to add a page break or HTML block
Copy/paste functions
Using Syntax blocks
When editing a template, there are syntax options that can be used to create templates to reflect specific conditions.
HANDLEBARS EXPRESSIONS
Handlebars Expressions are used to select VARIABLES associated to the document. Variables displayed in the drop down will be specific to the document and associated row.
'IF' BLOCK
Use the IF block in a document template when you want to display certain content or formatting only under specific conditions, based on your data. For example, you might want to show a field only if it’s not empty, or highlight a row only if a value exceeds a threshold.
Common scenarios:
Hide charges with amount 0: Use an IF block to only display a charge if its value is more than zero.
Show content conditionally: For example, display a note or section only if a field contains certain text (like a specific subcontractor name or a filled comment).
Conditional formatting: Make text bold or apply special styles when a value meets a condition (e.g., bold a location if a related note exists).
📚 IF blocks can be combined with ELSE for more complex logic.
FOR BLOCK
The FOR block is a powerful feature in the Qargo document template editor, enabling dynamic, data-driven document generation.
To list all products for an order, showing each product and its description on a new line, add a FOR block for the goods array and place the product details inside the block. The FOR block will ensure each product gets its own line in the final document.
COMBINE STATEMENT
Use the COMBINE block when you need to display a joined or aggregated list from an array in your template, such as joining a list of values into a comma-separated string.
Unlike a FOR block, which iterates over each item and renders content repeatedly, the Combine block processes the array to output a single result, typically by concatenating or otherwise aggregating its elements.
One important limitation is that you cannot use IF statements (conditional logic) inside a Combine block. This means that the Combine block is best suited for straightforward aggregation without item-level conditions.
Add new template
Navigate to CONFIGURATION > Templates
Click 'Add Template'
Select document type from the drop down list.
Note: additional options may be available, ie; "Invoice" gives an option for invoice or credit note or "Loading sheet" gives option for Trip or Resource
From the 'Visualise' panel, clicking in the 'Data Owner' field will display matching records for this type of document. Selecting one of these will update the template preview to show with customer data.
If the basic template provides all the data in the layout required, give the template a Name and click SAVE.
If modifications to the template layout is required, use the rows in 'Configure' to update the data.
Modify a Template
Template format is available in either html or pdf.
If using pdf, additional formatting is available. Expand the 'pdf configuration' row.
Changes made in the configuration panel will be previewed in the right panel.
To modify individual elements, clicking on the element will highlight which row the update is required.
Click into the row and the edit options will display.
Select the appropriate action from the options.
Once selected the modified data will update in the preview / visualise window to be confirmed.
Once the template matches the required layout and content, click SAVE.