Using {{{_keys}}} to inspect the current template context

The problem it solves

In Mustache templates a missing key renders exactly the same as an empty one — a blank. That makes it hard to know whether a placeholder you typed is simply empty for this record or does not exist at all. It is also hard to remember which keys are available inside a specific loop (for example, what fields are on a bomComponents entry versus a workOrders entry).

How to use it

  1. Open any Custom HTML export template for editing (Work Order, Production Run, Packing Slip, Purchase Order, Invoice, Assembly Order, or any label type).

  2. At the top of the template body, or inside the loop you want to inspect, type:

    {{{_keys}}}
    

    Note the triple braces — the output is an HTML table, so double braces would escape it.

  3. Export or preview the document. The placeholder renders as a table with two columns — Key and Type — listing every field available at that point in the template.

  4. Inside a loop (e.g., {{#bomComponents}}{{{_keys}}}{{/bomComponents}}), the table shows the loop entry's fields, not the document root's.

  5. Once you have found the keys you need, remove {{{_keys}}} before saving the published template. It is an authoring aid only.

Type words in the table

Type shownWhat it means
stringPlain text value
string (empty)Exists but is blank for this record
numberNumeric value; supports .raw, .formatted, etc. sub-keys
currencyCurrency value; same sub-keys as number
dateDate value; supports .short, .long, .iso, etc.
datetimeDate + time value; same sub-keys as date
map of NKey-value map (e.g., custom fields); use dot notation like orderCustomFields.myField
list of NArray / loop section; wrap in {{#name}}…{{/name}}
objectNested object; access with dot notation
booleanTrue/false; use as a conditional section {{#flag}}…{{/flag}}
nullField is present but has no value for this record

Works at every context level

  • Document root — place {{{_keys}}} outside any loop to see all top-level fields.
  • Inside any loop — place it inside {{#orderLines}}, {{#bomComponents}}, {{#workOrders}}, etc., to see that loop entry's fields.
  • Performance — the key inspection is skipped entirely if your template does not contain the text _keys, so there is no rendering overhead in published templates.

Placeholder browser tip

For Production Run templates, the placeholder browser in the editor now lists work-order custom fields in their own group (labelled "Work Order: Order Custom Fields — nested inside the {{#workOrders}} loop"), separate from the run's own batch-level custom fields. Use the browser to find field names, then use {{{_keys}}} inside the relevant loop to confirm the exact camelCase key and its type before writing your template markup.