Skip to main content

Data binding

Form field default values can reference $data paths, which are resolved before PDF generation. This lets you create templates with fields that arrive pre-populated from your data — recipients review and edit, rather than starting from scratch.

See Data Injection for the broader $data reference system.

Quoting rule

String values that contain $data references should be wrapped in single quotes within the tag, so the parser passes them through verbatim:

{ "p": "Full Name: [textfield, fullName, '$data.applicant.fullName', 200|20]" }

Numeric and boolean values don't need quotes:

{ "p": "[checkbox, termsAccepted, $data.preferences.termsAccepted, 16|16] I accept the terms" }

Pre-filled review form

Combine fields with $data to deliver pre-populated forms recipients can review and edit:

{
"table": {
"widths": [1, 2],
"rows": [
[
{ "p": "Full Name:", "style": "fieldLabel" },
{ "p": "[textfield, fullName, '$data.applicant.fullName', 220|22]" }
],
[
{ "p": "Email:", "style": "fieldLabel" },
{ "p": "[textfield, email, '$data.applicant.email', 220|22]" }
],
[
{ "p": "Phone:", "style": "fieldLabel" },
{ "p": "[textfield, phone, '$data.applicant.phone', 220|22]" }
],
[
{ "p": "Department:", "style": "fieldLabel" },
{ "p": "[choicefield, dept, Engineering|Sales|Operations, 0, 200|22]" }
]
]
}
}

When generated with this data:

{
"applicant": {
"fullName": "Sophie Müller",
"email": "sophie.mueller@example.com",
"phone": "+49 30 1234 5678"
}
}

The resulting PDF text fields arrive pre-filled — and recipients can still edit them.

Common patterns

Optional fields

Use empty defaults so recipients see blank fields:

{ "p": "Notes:[br][textarea, notes, , 400|80]" }

Conditional pre-fill via the data layer

When a value may be missing, supply a default at the data layer rather than in the tag — keeps the template clean:

{ "p": "Reference: [textfield, reference, '$data.shipment.reference', 220|22]" }
{ "shipment": { "reference": "" } }

Read-only via styling

Form fields stay editable by default. To deliver a static rendering of values, use plain paragraph text instead of a field tag.