Print Templates
Generate printable documents — certificates, forms, receipts — from collection data using Liquid templates.
The print Field
A printable button is an alias field on the collection:
type: "alias",special: ["alias", "no-data"]interface: "print"- Options:
{
"templateSelection": {
"collection": "print_template",
"key": "<template-row-uuid>"
},
"fields": ["*.*.*"]
}fields controls how deep the item is resolved when handed to the template — "*.*.*" resolves relations three levels deep.
Templates themselves are rows in the print_template collection containing LiquidJS HTML. Keep a local copy of each template under source control; re-fetch template row UUIDs by name before writing them into field options (terminal output can clip long UUIDs).
Template Context
The template's context is the item resolved to fields depth:
- M2O fields arrive as nested objects —
{{ order.customer.name }}. - O2M fields arrive as arrays — iterate directly:
{% for line in order.lines %}
{{ line.product.name }} — {{ line.qty }}
{% endfor %}Verified filters and tags: default, date, upcase, capitalize, replace, newline_to_br, {% case %}.
Letterheads via a Settings Singleton
To give every document a branded letterhead (org name, logo, address):
- Add a
settingsM2O field on the printable collection pointing at your settings singleton. - Stamp it automatically with an
items.createevent flow whose Update Data operation writeskey: "{{$trigger.key}}"withemitEvents: falseandpermissions: "$full". - Backfill existing rows once.
Templates then read {{ settings.org_name }}, {{ settings.address }}, and so on. For multi-tenant deployments the "singleton" becomes one row per tenant — templates keep using settings.* unchanged.
csv Fields Arrive as JSON Strings
A csv field reaches the template as the string '["a","b"]' — not an array. Iterate it with:
{% assign tags = field | split: ',' %}
{% for t in tags %}
{{ t | replace: '[', '' | replace: ']', '' | replace: '"', '' }}
{% endfor %}The same caveat applies in SQL — see csv fields in SQL.
Multiple Print Fields Per Collection
Several print alias fields can coexist on one collection — for example print, print_settlement, print_certificate — each pointing at a different print_template row.
QR Verification Codes
Embed a QR that resolves to your public verification page (see Public Endpoints & Portals):
<img src="https://api.qrserver.com/v1/create-qr-code/?size=120x120&data={{ verify_url }}"
width="120" height="120" />Point verify_url at your portal — for example https://your-portal.com/verify/{{ serial }}. A printed document then self-verifies when scanned.