Data panel

The sample data editor, binding paths, schema and missing-data preview. Right panel in the DocStudio designer interface.

The Data tab is where you provide the sample data that the canvas uses. The sample data is not part of the template: the host keeps it and your template will later be merged with real data.

The tab is made of three accordions: Sample data (open), Binding paths (closed, with the schema line) and Missing data (closed). Open any of them; several can stay open.

Sample data editor

The Data tab

A text area holds the sample as JSON. Edit it and press Apply. The button is disabled until the text differs from the current sample. When you apply:

  • text that is not JSON is refused with "The JSON is not valid",
  • JSON that exceeds the size limits is refused with "The sample data is not valid" and the reason,
  • valid data replaces the sample at once and the canvas, the bindings preview and the Problems tab update.

Load from file reads a JSON file (up to 10 MB) into the text area. Press Apply to use it.

Schema

Below the editor a line tells where the data schema comes from:

Label Meaning
Schema supplied by the host The host passed a data schema. It always wins
Schema inferred from the sample The designer inferred a schema from the first 1,000 items of each list in your sample
No schema There is no sample or schema

A schema is advisory. It adds warnings for paths that are not in the data and for values of the wrong type. It never changes the output.

Binding paths

The Binding paths list shows every path the data offers with its type, for example invoice.number string or items array. Use it to find the exact path to bind. The list is capped at 500 entries.

Missing data preview

The last section explains how the active policy treats four situations, using a built-in example:

Case Meaning
missing key The path does not exist in the data
null value The path exists and is null
wrong type The value has a type the element cannot use, for example an object in a text
present A normal value

The page policy (blank, placeholder, warn or error) is shown above the table. See Missing, null and wrong-type data.

How the sample affects the preview

Every binding in the template is evaluated against the sample. An empty sample ({}) makes every binding missing, so text shows the placeholder, a dash by default.

Limits

  • Very large samples build the whole JSON text for this tab, which can be slow.
  • Lists are shortened to 50 rows in the canvas only.