Authoring guide

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 you through every binding shape with a side-by-side of the Word excerpt and the rendered output.

On this page 1. Token basics 2. Lookups (N:1) 3. Multi-hop chains 4. Choice + status fields 5. Repeating rows (1:N) 6. Number, date, currency 7. What gets fetched 8. Full sales-order example

1Token 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 into the same place in the document — preserving every Word run, font, colour, and table cell around it.

Word template

Order for {{name}}

Status: {{statecode}} · Created {{createdon}}

Total amount: {{totalamount}}

Rendered

Order for Acme Industrial Pumps

Status: Active · Created 06/05/2026

Total amount: £8,340.00

i
Use logical names, not display names. Templ8r reads from the Dataverse Web API, so {{name}} works but {{Order Name}} won't. Hover any column in the Templ8r mapper to see its logical name.

2Lookups (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.

Word template

Customer: {{customer.name}}

Primary contact: {{customer.primarycontactid.fullname}}

Account manager: {{ownerid.fullname}}

Rendered

Customer: Acme Industrial Pumps

Primary contact: Sarah O'Connell

Account manager: Jamie Reid

Token shape: {{relationshipName.column}} — where relationshipName is the schema name of the lookup column or its navigation property (e.g. customerid_account or primarycontactid).

3Multi-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.

Word template

Bill to: {{customer.name}}

Parent group: {{customer.parentaccountid.name}}

Group region: {{customer.parentaccountid.territoryid.name}}

Region manager: {{customer.parentaccountid.territoryid.managerid.fullname}}

Rendered

Bill to: Acme Industrial Pumps

Parent group: Acme Holdings plc

Group region: EMEA North

Region manager: Lena Hartwell

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) ) ) )
!
Polymorphic lookups (e.g. the 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.

4Choice + 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.

Word template

Status: {{statecode}} ({{statuscode}})

Priority: {{prioritycode}}

Payment terms: {{paymenttermscode}}

Rendered

Status: Active (New)

Priority: High

Payment terms: Net 30

?
Need the raw value? Append .raw{{statecode.raw}} renders 0 instead of Active. Useful when downstream systems expect integers.

5Repeating 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.

Word template
ProductQtyUnitTotal
{{lines.productname}} {{lines.quantity}} {{lines.priceperunit}} {{lines.extendedamount}}
Rendered
ProductQtyUnitTotal
Centrifugal pump CF-2203£1,420.00£4,260.00
Pressure gauge PG-128£185.00£1,480.00
Pipe fitting kit (¾")2£1,300.00£2,600.00

Token shape: {{collectionName.column}} — where collectionName is the 1:N relationship name (e.g. order_details, aliased to lines in the mapper for readability).

i
Empty collections. If a record has no related rows, the entire repeating row drops out — header and footer remain. No empty placeholder rows, no "there are no items" text required.

6Number, date, currency

Append a format hint after a colon. Hints are passed 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.

7What 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.

A template with eight scalar tokens and one relationship hop fires one Dataverse request that returns a JSON payload covering exactly those nine columns. A 1:N collection token wraps a side-array under the same response — still one round-trip.
Lookup → _col_value translation

Lookup, 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 resolution

Choice 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 hints

Format 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.

8Full 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.

Word template

SALES ORDER {{ordernumber}}

Created {{createdon:dd MMM yyyy}} · {{ownerid.fullname}}

Bill to

{{customer.name}}

{{customer.address1_composite}}

Account: {{customer.parentaccountid.name}}

ProductQtyUnitTotal
{{lines.productname}} {{lines.quantity}} {{lines.priceperunit:C}} {{lines.extendedamount:C}}

Subtotal: {{totalamount:C}}

Tax: {{totaltax:C}}

Due: {{totalamount_lineamount:C}}

Rendered

SALES ORDER SO-2026-0418

Created 06 May 2026 · Jamie Reid

Bill to

Acme Industrial Pumps

42 Foundry Lane, Sheffield S1 4AB, UK

Account: Acme Holdings plc

ProductQtyUnitTotal
Centrifugal pump CF-2203£1,420.00£4,260.00
Pressure gauge PG-128£185.00£1,480.00
Pipe fitting kit (¾")2£1,300.00£2,600.00

Subtotal: £8,340.00

Tax: £1,668.00

Due: £10,008.00

Bring your own template.

Drop tokens into your existing branded Word file and we'll wire it up against your Dataverse environment in a fifteen-minute call. No re-design, no redaction, no homework.