Docs
EN
Sign up

Data Schema and Default Data

A template’s schema defines the fields it accepts and their types. Default Data provides values for the editor preview and for fields omitted from a document generation request.

For example, an invoice template can define a customer name, invoice number, and collection of line items. Default data lets you design that invoice with realistic values before connecting your own application.

Open the data tools

Open a template in the editor, then select Data Fields in the inspector on the right. This panel lists your fields and has two buttons:

  • Edit schema opens the Field Editor, where you define the structure of your data.
  • Default data opens the values used to preview the template and fill in omitted input.

After defining your fields, drag them from Data Fields onto Text elements or table headers to bind them to the layout.

Schema

Define fields

  1. Click Edit schema and select the Fields tab.
  2. Click Add field, enter a field name, and choose its type.
  3. For an Object or Collection, use Add child to define the fields inside it.
  4. Click Apply changes when the schema is ready.

Field names become keys in your JSON input. Use letters, numbers, and underscores, starting with a letter or underscore: customer_name is valid; customer name and 1customer are not. Names must be unique within the same parent, so customer.name and company.name can both exist.

You can search fields by name, drag their handles to reorder them within a parent, and undo or redo changes while the Field Editor is open. Cancel closes the dialog without applying its changes.

Choose field types

TypeUse it for
StringText such as names, addresses, or descriptions.
NumberQuantities, prices, percentages, and other numeric values. Send JSON numbers such as 2 or 19.95, rather than quoted text.
BooleanA true or false value, such as whether an invoice is paid.
DateA calendar date such as "2026-10-01".
Date/TimeA timestamp such as "2026-10-01T09:30:00Z".
ObjectA group of related fields, such as a customer with a name and address.
CollectionAn array of objects with the same fields, such as invoice line items.
List of strings, numbers, booleans, dates, or date/timesAn array of simple values of one type, such as ["priority", "paid"].
Calculated numberA numeric result calculated from a sibling Collection or List. This option becomes available when a suitable source exists.

Calculated fields are computed by the template. They are omitted from the input JSON Schema and the Default Data form, so you do not need to supply them yourself.

Organize nested data

Use Objects to group fields and Collections for repeating records. For a simple invoice, create this structure:

invoice                  Object
|-- number               String
|-- currency             String
`-- items                Collection
    |-- description      String
    |-- quantity         Number
    `-- unit_price       Number

Each item in invoice.items is an object with its own description, quantity, and unit_price. Use a Collection when a table or repeating layout needs several fields per item. Use a List when each item is just one value.

When you rename a field, the editor updates its existing layout references and carries its default value to the new name. Removing a field that is used in the layout prompts you to confirm removal of its references. Review the preview after changing the schema, especially after changing field types.

Export JSON Schema

In the Field Editor, select JSON Schema and click Copy to share the input structure with your integration. This view is read-only and is generated from the current fields; edit the Fields tab to change it.

The exported schema describes nested objects, arrays, and field types. Input fields are optional because omitted values use template defaults. Calculated fields are excluded, and extra keys outside the schema are not allowed.

Default Data

Edit default values

Open Default data from the Data Fields panel. Choose the view that suits your workflow:

  • Builder provides inputs for each field. Use Add item for Collections and Add value for Lists. Collection items can be duplicated or deleted.
  • JSON lets you paste or edit the complete data object. Format JSON formats valid JSON without changing its values.

For the invoice schema above, enter:

{
  "invoice": {
    "number": "INV-1042",
    "currency": "USD",
    "items": [
      {
        "description": "Design services",
        "quantity": 2,
        "unit_price": 50
      }
    ]
  }
}

The editor checks the data against your schema. Correct any JSON or type errors until Matches schema appears, then click Apply changes.

Reset from schema replaces your edited default data with values generated from the schema. Use it when you want to start again, then review the generated values before applying them. Builder edits support undo and redo; those controls are disabled in the JSON view.

How request data overrides defaults

When you generate a document, supplied values override the template’s defaults. Nested objects are merged, so you can send only the fields you want to change.

With the defaults above, this request data changes the invoice number while retaining currency and items:

{
  "invoice": {
    "number": "INV-1043"
  }
}

Collections and Lists are replaced as complete arrays, rather than merged item by item. Sending "items": [] produces an empty collection; it does not reuse the default items. Supplied values such as 0, false, or an empty string also override defaults. A supplied null does not fall back to the default and can fail type validation.

Choose default values that you intend to appear when input is omitted, since they affect generated PDFs as well as previews.

Save, preview, and publish

Apply changes updates the open editor. Save the template to keep your changes, and use Preview PDF to check the layout with its default data.

Publish the template when it is ready for generation. Schema and default data changes become available to generation requests when you publish a new revision; editing a draft does not change the existing published revision.

Next steps