Template examples.
A Templ8r template is just a Word document with merge tokens. Drop {{column}} placeholders where you want values, save, upload — done. This page walks every binding shape with a side-by-side of the Word excerpt and the rendered output.
01Token basics
A token is the column's logical name wrapped in double curly braces. Templ8r reads the value off the record and pastes it back in the same place — preserving every Word run, font, colour, and table cell around it.
{{name}} works but {{Order Name}} won't. Hover any column in the Templ8r mapper to see its logical name.02Lookups (N:1)
Reach into a related record with dot syntax. Reference the relationship's navigation property, then the column on the target entity. Lookup-type columns (Lookup, Owner, Customer) are auto-translated to their _col_value form — you write the friendly name, Templ8r handles the protocol.
Token shape: {{relationshipName.column}} — where relationshipName is the schema name of the lookup column or its navigation property (e.g. customerid_account or primarycontactid).
03Multi-hop chains
Chain dots to walk N:1 lookups to any depth. Templ8r compiles the whole binding set into a single nested $expand with column-scoped $select at every hop — one record fetch, full document tree.
Compiled query (peek under the hood):
// Templ8r builds this for you, given the four bindings above GET /api/data/v9.2/salesorders({id})? $select=name &$expand=customerid_account( $select=name; $expand=parentaccountid( $select=name; $expand=territoryid( $select=name; $expand=managerid($select=fullname) ) ) )
customer column on a sales order, which can target either Account or Contact) need the navigation-property variant in the chain — customerid_account for accounts, customerid_contact for contacts. The visual mapper picks the right one for you.04Choice + status fields
Option-set, status, and statecode fields render as their friendly label by default — Dataverse provides a FormattedValue annotation alongside the raw integer, and Templ8r prefers the friendly form so your document reads naturally without any extra mapping.
.raw — {{statecode.raw}} renders 0 instead of Active. Useful when downstream systems expect integers.05Repeating rows (1:N)
For order lines, invoice items, contacts on an account — anything that's a 1:N collection. Place tokens inside a Word table row and Templ8r repeats the row for every related record. Header and footer rows pass through untouched.
Token shape: {{collectionName.column}} — where collectionName is the 1:N relationship name (e.g. order_details, aliased to lines in the mapper for readability).
06Number, date, currency
Append a format hint after a colon. Hints pass through to the same .NET formatting engine OpenXML merges use under the hood, so anything ICU/.NET supports works.
{{totalamount:C}}Currency in tenant culture. £8,340.00 in en-GB, $8,340.00 in en-US. Use :C2 to force two decimals.
{{totalamount:N0}}Number with thousands separator, no decimals. 8,340.
{{createdon:d}}Short date in tenant culture. 06/05/2026 in en-GB, 5/6/2026 in en-US.
{{createdon:dd MMMM yyyy}}Custom date format. 06 May 2026.
{{createdon:HH:mm}}Time only, 24-hour. 14:32.
{{discount:P1}}Percentage with one decimal. 12.5% for a stored value of 0.125.
- Colon-direct (D365 / Word native):
{{totalamount:C}},{{createdon:dd MMM yyyy}}. The spec after:is passed straight to.ToString(spec, culture)— any standard .NET format string works, including ones with internal colons likeHH:mm. Currency, percentage, short/long dates all follow tenant culture. - Pipe form (named formatters with options):
{{totalamount | currency:GBP}},{{createdon | date:short}}. Use this when you need to override the tenant culture — e.g. forceGBP,USD, orEURregardless of the running culture. Named formatters:currency,number,date,upper,lower.
07What gets fetched
Only the columns referenced in the template's bindings hit Dataverse. Templ8r builds an entity-scoped $select from your bindings, plus nested $expands for any relationship paths. No SELECT *, no over-fetching, no surprise rows in your audit log.
Lookup → _col_value translationLookup, Owner and Customer columns are auto-rewritten to _col_value in the $select. You write {{ownerid.fullname}}, Templ8r requests _ownerid_value and walks the FormattedValue annotation to render Jamie Reid.
FormattedValue resolutionChoice fields, money columns and dates carry an @OData.Community.Display.V1.FormattedValue annotation. Templ8r prefers it over the raw integer/decimal so your document reads as a human would — without you mapping option-set keys to labels.
Token-level format hintsFormat hints are applied after Dataverse responds, in our merge engine. They never alter the $select — so adding or removing :C2 doesn't change what gets fetched.
08Full sales-order example
Putting it all together. Below is the entire Word excerpt for a branded sales order — header, customer block, line items, totals — and what it renders for the demo Acme record.