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:

PropertyTypeDescription
typeenumThe field type (see below). Defaults to TEXT.
labelstringThe field's display label.
namestringA 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.
requiredbooleanWhether an answer is required. Defaults to false. Combined with a condition, it means "required when visible".
mapTostringMaps the answer to a signer. See Signers.
conditionobjectVisibility rule. See Conditional Fields & Sections.
multipleEntriesobjectMakes the field repeatable — { "max": N }. Not supported by HTML or FILE.
prefilledobjectA static default value set in the form. See Static prefill.

Field types

TypeWritableType-specific propertiesValidations
TEXTyesmultilineminLength, maxLength, exact, digitsOnly
NUMBERyesallowDecimals, min, max, minLength, maxLength
DATEyesdateFormatminDate, maxDate
DATETIMEyesdatetimeFormatminDate, maxDate
EMAILyesminLength, maxLength
PHONEyescountryCodesminLength, maxLength
NINyescountryCodes
BUSINESS_IDyescountryCodes
CHOICEyeslayout, optionsmin, max (number of selections)
FILEyesdescriptionmin, max (number of files)
HTMLnocontent

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:

ValidationApplies toDescription
minLengthTEXT, NUMBER, EMAIL, PHONEMinimum string length. For NUMBER, counts the total string including any decimal point or minus sign.
maxLengthTEXT, NUMBER, EMAIL, PHONEMaximum string length.
exactTEXTThe value must equal this exact string.
digitsOnlyTEXTThe value may contain digits only.
allowDecimalsNUMBERWhether decimal values are allowed.
min / maxNUMBERNumeric bounds.
min / maxCHOICEMinimum / maximum number of options the respondent must select.
min / maxFILEMinimum / maximum number of files.
minDate / maxDateDATE, DATETIMEEarliest / 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 MM for months. Lowercase mm means 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:

layoutRenders asTypical use
SELECTDropdownMany options, single selection
RADIORadio buttonsFew options, single selection
CHECKBOXCheckboxesMultiple 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 }
}
PropertyTypeDescription
valueanyThe default value. Its shape must match the field type (the same shapes as a prefilled request; see Field value formats).
editablebooleanWhether 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.