Skip to main content
Elements are the building blocks of a form. Each step holds a list of them: input fields that collect an answer, content blocks that only display something, and a few technical elements that drive behaviour. Every option on this page is read by the form engine.

Anatomy of an element

An element is an object with a type. Everything else is optional and depends on that type.
These properties work on every element type:

How elements behave

The key decides where the answer lands in the form data.A key without a dot is automatically prefixed with data. — so "key": "birth_date" stores the answer in data.birth_date. A key that already contains a dot is used as-is, which is how you write into the contact:
An element with no key collects nothing. That is expected for content blocks such as paragraph or image.
title accepts a plain string, or an object carrying an extra help message shown next to the label:
Some elements also accept a label, which is the text shown inside the control rather than above it — the text next to a checkbox, or the caption of a button. Where both exist, title is the field label and label is the control’s own text.
required: true only takes effect when the element can actually be answered. The engine ignores it when there is nothing to answer: a choices element with an empty choices list, a signature or download with no items, and always on paragraph, image and toggle.A required checkbox must be checked, not merely answered.
To show an element only under a condition, wrap it in an :if / :then block instead of putting a property on the element:
:then accepts a single element or an array of elements. The full operator syntax lives in the penscript reference.
Most interactive elements accept submit_on_change. When set to true, answering the element submits the step immediately instead of waiting for the submit button. The Studio labels this option Auto-advance.
Auto-advance works well on a step that asks a single question — a yes/no choice that branches the rest of the form. On a step with several fields it submits before the contact is done.

Text and numbers

Single-line or multi-line free text. format also turns it into an email or phone input.
For phone numbers, the phone element gives a better experience than format: "tel": country prefix selector, national formatting, and mobile-only validation.
Same shape as number, but the answer is always capped at two decimals and rendered with thousands separators.
The answer is validated against the IBAN checksum, stored without spaces, and displayed grouped by four characters.

Dates

The answer is stored as YYYY-MM-DD.
Same options as date, minus picker. The answer is stored as an ISO 8601 timestamp.

Contact details

Phone input with a country prefix selector. The answer is stored in international E.164 format, and displayed in national format when it matches the configured country.
Use accept: "mobile" whenever you plan to send an SMS — a reminder, or an SMS signature. It stops a landline from being accepted at fill time instead of failing silently later.
The list is built from the ISO 3166 country list and translated into the form locale (English, French, Dutch and German; any other locale falls back to English). The answer is stored as a two-letter country code.

Choices and ratings

Every choice element shares the same choices list:
value can be a string, a number, a boolean or null. label is what the contact reads; when omitted, the value itself is displayed. A label can also carry help text, like a title: { "text": "Car", "help": "Including vans under 3.5t" }.
A null choice — an explicit “none of these” — is only added when the element is not required.
Handles both single and multiple selection, and renders either as a list or as cards.With max: 1 the answer is stored as a single value; otherwise it is stored as an array.
Multiple selection rendered as a list of checkboxes. Same options as choices.
Single selection rendered as radio buttons.
Single selection rendered as a row of toggle buttons. Same options as radio.
Single selection from a searchable dropdown. Use it when the list is too long for radio buttons.
For a consent or an acknowledgement. The answer is a boolean.
A required checkbox must be ticked to pass validation. Unticking it blocks the step.
Same options as checkbox, plus inline to place it on the same line as its title.A toggle can never be required — use a checkbox when the answer must be positive.
The answer is an integer between 0 and 5. This element takes no options.

Files and signatures

accept is a single comma-separated string, not an array. It takes extensions (.pdf), exact MIME types (application/pdf) and wildcards (image/*).
Offers one or more documents to the contact — a policy, a quote, terms and conditions. Documents can be filled with form data before being served.
A signature with an empty items list cannot be required — there is nothing to sign. The same applies to download.

Content blocks

These elements display something and collect no answer. They take no key and cannot be required.
Optionally with an icon, a colour and action buttons.

Technical elements

You rarely need to declare it: when a step contains no submit element, one is appended automatically — unless the last element of the step has submit_on_change: true, in which case answering it submits the step.
Use it to branch a form without a visible choice list.
Typically used to carry a campaign source, an external identifier, or a computed value.
A required hidden element blocks the form until the value is non-empty — useful to guarantee that a computed value was actually resolved.
Calls an external API from inside the form and stores the response, so later steps and pricing can use it.
Without invalidate_on_change, a contact who goes back and changes an input keeps the response computed from the old answers. List every key the call depends on.
Sends the contact to an external web flow — an identity check, a third-party payment — and stores what comes back.

Next steps

Steps and logic

Organise elements into steps and branch on answers

Portal pages

Welcome, review and ending screens

Penscript

The expression language behind conditions and variables

Form templates

Back to form templates