Skip to Content
DocumentationConceptsEditorHow variables bind to content

Variables are what make a template reusable. A chip in your content says “fill me in with the customer’s name”; the schema says what fields exist and what type each one is; sample data gives you concrete values to preview against while authoring. These three live in a triangle — ignore any one and the other two get confusing.

The three parts

Variable chipin editor content
→reads
Schema fieldtype + default
sample_datapreview only
Fill payloadproduction, at render

The chip lives inside your content. It’s a placeholder that reads {{customer_name}} or {{customer.address.city}} and renders as filled content when the template renders.

The schema sits beside the template. It lists every field the template expects to see at fill time, with each field’s type (text, number, date, list, and so on) and an optional default.

The sample data is a small set of concrete records you author alongside the schema. The editor’s preview mode fills the template against one sample record at a time so you can see exactly what the output will look like before a real fill arrives.

Variable chips in content

A chip is rendered inline in the editor and looks different from surrounding prose — a coloured pill, named after the field it reads. The underlying content stores a variable path like customer.name or line_items[].total, which the editor converts to the display label at paint time.

The expression inside a chip is a path into the fill-in payload, not a free-form template expression. See Schema for the field types available.

Schema: the shape of fillable data

A schema is a named shape. It belongs to the template (or to a Composite’s role, if the template is referenced from one), and declares:

  • Fields, each with a key and a type.
  • Defaults, an optional starting value for each field.
  • Required vs. optional, marking which fields a fill is expected to supply. In a pipeline, validation rules decide what happens when a required value is missing.

The schema is not the source of truth for how a field renders — only for what it is. Rendering (date format, currency format, truncation) is a per-chip choice. See the next section.

Sample data: multiple preview records

Sample data is a small list of records that match the schema shape. The preview switcher in the editor lets you flip between records to see how the template behaves under different inputs — a long customer name vs. short, an invoice with one line item vs. ten, a date in January vs. December.

Sample data is authoring-only. It never reaches production fills. In production the fill payload arrives from a form submission, a pipeline, or an API call, and the editor’s sample records are not consulted.

At fill time

When a real fill payload arrives — from a submitted form, a pipeline that fetched data from a CRM, or an API caller — the renderer:

  1. Resolves each variable chip’s path against the payload. A path the payload doesn’t supply shows the chip’s fallback value if it has one, otherwise the path itself.
  2. Applies per-chip format options to turn the resolved value into display text.
  3. Emits the filled content as HTML / PDF / whatever the render target is.

Format options are per-chip, not per-field

The same date field can render as March 15 in the header chip and 03/15/2025 in a signature line. Each chip picks its own format option.

This is deliberate: a template usually wants the same field to appear differently in different places. The schema would be the wrong place to pin a format — it would force every mention to render identically. The chip is the right place, because the chip is where the author makes the rendering call.

Each field type has its own set of format options — date formats, number formats, currency symbols.

See also

  • How forms work — forms author submissions that match a schema and feed variables
  • Schema — the full schema model, including how a Composite binds fields across sections
Last updated on