Field Types & Validation
Every field has a type. The type decides which properties and validations the field accepts. This page is the complete reference.
Common properties
These apply to input fields regardless of type:
| Property | Type | Description |
|---|---|---|
type | enum | The field type (see below). Defaults to TEXT. |
label | string | The field's display label. |
name | string | A stable identifier for the field. Auto-generated from the type, label, and position if omitted. Needed to reference the field in conditions and merge fields. Must be unique within the form. |
required | boolean | Whether an answer is required. Defaults to false. Combined with a condition, it means "required when visible". |
mapTo | string | Maps the answer to a signer. See Signers. |
condition | object | Visibility rule. See Conditional Fields & Sections. |
multipleEntries | object | Makes the field repeatable — { "max": N }. Not supported by HTML or FILE. |
prefilled | object | A static default value set in the form. See Static prefill. |
Field types
| Type | Writable | Type-specific properties | Validations |
|---|---|---|---|
TEXT | yes | multiline | minLength, maxLength, exact, digitsOnly |
NUMBER | yes | — | allowDecimals, min, max, minLength, maxLength |
DATE | yes | dateFormat | minDate, maxDate |
DATETIME | yes | datetimeFormat | minDate, maxDate |
EMAIL | yes | — | minLength, maxLength |
PHONE | yes | countryCodes | minLength, maxLength |
NIN | yes | countryCodes | — |
BUSINESS_ID | yes | countryCodes | — |
CHOICE | yes | layout, options | min, max (number of selections) |
FILE | yes | description | min, max (number of files) |
HTML | no | content | — |
HTML is a display-only field: it renders content but collects no answer, so it can't be required, mapped, prefilled, or used as a condition target.
Validations
Pass validations under a validations object on the field:
| Validation | Applies to | Description |
|---|---|---|
minLength | TEXT, NUMBER, EMAIL, PHONE | Minimum string length. For NUMBER, counts the total string including any decimal point or minus sign. |
maxLength | TEXT, NUMBER, EMAIL, PHONE | Maximum string length. |
exact | TEXT | The value must equal this exact string. |
digitsOnly | TEXT | The value may contain digits only. |
allowDecimals | NUMBER | Whether decimal values are allowed. |
min / max | NUMBER | Numeric bounds. |
min / max | CHOICE | Minimum / maximum number of options the respondent must select. |
min / max | FILE | Minimum / maximum number of files. |
minDate / maxDate | DATE, DATETIME | Earliest / latest accepted date. |
{
"type": "NUMBER",
"label": "Bank Account Number",
"required": true,
"validations": { "minLength": 10, "maxLength": 10, "allowDecimals": false }
}Text and numbers
multiline turns a TEXT field into a textarea for longer answers:
{ "type": "TEXT", "label": "Additional Comments", "required": false, "multiline": true }Dates
dateFormat (and datetimeFormat for DATETIME) controls how the value is rendered in the signed PDF, using Java date patterns. Defaults to dd/MM/yyyy.
Use uppercase
MMfor months. Lowercasemmmeans minutes and gives the wrong output.
{ "type": "DATE", "label": "Date of Birth", "required": true, "dateFormat": "dd/MM/yyyy" }National and business IDs
NIN (national ID) and BUSINESS_ID validate the format for the countries you list in countryCodes:
{ "type": "NIN", "label": "National ID", "required": true, "countryCodes": ["DK", "NO", "SE"] },
{ "type": "BUSINESS_ID", "label": "Business Number","required": true, "countryCodes": ["DK", "NO", "SE", "BE"] }Phone
PHONE validates format and lets the respondent pick a country code:
{ "type": "PHONE", "label": "Phone Number", "required": true, "countryCodes": ["DK", "NO", "SE", "DE", "GB"] }Choices
CHOICE presents options in one of three layouts:
layout | Renders as | Typical use |
|---|---|---|
SELECT | Dropdown | Many options, single selection |
RADIO | Radio buttons | Few options, single selection |
CHECKBOX | Checkboxes | Multiple selections |
Each option has a label (shown) and a value (submitted). Set selected: true on an option to pre-select it.
{
"type": "CHOICE",
"label": "Employment Type",
"required": true,
"layout": "RADIO",
"options": [
{ "label": "Full-time", "value": "fulltime" },
{ "label": "Part-time", "value": "parttime" },
{ "label": "Contract", "value": "contract" }
]
}Files
FILE lets the respondent upload one or more files. Bound the count with min / max:
{ "type": "FILE", "label": "Supporting Documents", "required": true, "validations": { "min": 1, "max": 3 } }HTML content
HTML fields display formatted instructions. Only the following tags are allowed:
<p><em><strong><ul><ol><li><br><a[href]>
{
"type": "HTML",
"content": "<p><strong>Welcome!</strong></p><ul><li>Ensure all information is accurate</li><li>You'll receive a copy via email</li></ul>"
}HTML content can embed merge fields to reflect earlier answers back to the respondent.
Static prefill
The prefilled property sets a default value in the form itself, so every respondent starts from that value. This is different from a prefilled request, which sets values per link.
{
"type": "CHOICE",
"label": "Country",
"layout": "SELECT",
"options": [
{ "label": "Denmark", "value": "DK" },
{ "label": "Sweden", "value": "SE" }
],
"prefilled": { "value": ["DK"], "editable": true }
}| Property | Type | Description |
|---|---|---|
value | any | The default value. Its shape must match the field type (the same shapes as a prefilled request; see Field value formats). |
editable | boolean | Whether the respondent can change it. Defaults to false (locked). |
Only writable field types support prefilled; the value cannot be blank and must be valid for the field.
Updated 3 days ago
