Anatomy of an element
An element is an object with atype. Everything else is optional and depends on that type.
How elements behave
Keys — where the answer is stored
Keys — where the answer is stored
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:key collects nothing. That is expected for content blocks such as paragraph or image.Titles and help text
Titles and help text
title accepts a plain string, or an object carrying an extra help message shown next to the label: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 — and when it is ignored
Required — and when it is ignored
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.Showing an element conditionally
Showing an element conditionally
: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.Auto-advance — submitting on answer
Auto-advance — submitting on answer
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.Text and numbers
text — free text, email or phone
text — free text, email or phone
format also turns it into an email or phone input.phone element gives a better experience
than format: "tel": country prefix selector, national formatting, and
mobile-only validation.number — numeric input
number — numeric input
currency — monetary amount
currency — monetary amount
number, but the answer is always capped at two decimals and rendered with thousands separators.bank-account — IBAN
bank-account — IBAN
Dates
date — date picker
date — date picker
YYYY-MM-DD.datetime — date and time picker
datetime — date and time picker
date, minus picker. The answer is stored as an ISO 8601 timestamp.Contact details
phone — phone number
phone — phone number
country — country picker
country — country picker
Choices and ratings
Every choice element shares the samechoices 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" }.
null choice — an explicit “none of these” — is only added when the element
is not required.choices — the general-purpose selector
choices — the general-purpose selector
max: 1 the answer is stored as a single value; otherwise it is stored as an array.checkboxes — multiple selection
checkboxes — multiple selection
choices.radio — single selection
radio — single selection
toggles — single selection as buttons
toggles — single selection as buttons
radio.autocomplete — searchable dropdown
autocomplete — searchable dropdown
checkbox — a single box to tick
checkbox — a single box to tick
toggle — a single switch
toggle — a single switch
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.rating — five stars
rating — five stars
Files and signatures
file — upload
file — upload
accept is a single comma-separated string, not an array. It takes
extensions (.pdf), exact MIME types (application/pdf) and wildcards
(image/*).download — documents to download
download — documents to download
signature — electronic signature
signature — electronic signature
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 nokey and cannot be required.
paragraph — a block of text
paragraph — a block of text
card — a highlighted block
card — a highlighted block
image — an image
image — an image
Technical elements
submit — the step button
submit — the step button
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.api — call an external API mid-form
api — call an external API mid-form
webflow — hand over to an external flow
webflow — hand over to an external flow