Skip to content

Spec reference (v6)

A formancy form. The document holds the data contract only: what the form collects, and under what names. How it looks and when it appears are separate concerns, so the same form can have more than one presentation. specVersion says which version of this format it is written against.

required · one of "1", "2", "3", "4", "5", "6" · default "6"

Spec version. Which version of the document format this form is written against. Independent of the package version. A version is frozen once it is released: a document that validates today will validate against every future release that speaks its version, save one that keys a field or a matrix row __proto__, which no release could store an answer under. Each version is a superset of the one before and removes nothing, so a document of an older version is also a valid document of every newer one, and upgrading is a one-line change. The other direction is refused rather than guessed at: a reader that speaks only an older version rejects a document written against a newer one instead of dropping the part it does not know. Version 2 added field types, widgets and layout kinds; version 3 the signature field type, the check and skip rule kinds and the tagpicker widget; version 4 the ranking and matrix field types, the rating and slider widgets, and the step, mask and option image properties; version 5 the description, autocomplete, placeholder, default and shuffle field properties, an option’s exclusive and keepPlace, and a validate rule’s message; version 6 a time or datetime field’s precision. The default is the newest version, which is the one this package writes.

required · Form ID (see below) · max length 128 · pattern ^[A-Za-z0-9][A-Za-z0-9._-]*$

Form ID. The form’s stable identifier. It appears in the form’s URL and in exported data, so choose it once and leave it alone: changing it breaks existing links and detaches the submissions already collected.

Examples: "contact-us", "expense-claim"

required · string · min length 1 · max length 200

Title. The form’s name, as the person filling it in will read it at the top of the page.

Examples: "Contact us", "Expense claim"

required · Data model (see below)

Data model. Everything the form collects.

optional · Logic (see below)

Logic. The form’s behaviour: when fields show, what they compute, and what counts as a valid answer. Rules live here, apart from the data model, so the same model can carry different behaviour per deployment and so a rule can be reviewed on its own.

optional · Translations (see below)

Translations. The form’s words, apart from its structure.

optional · array of Layout

Layouts. Named arrangements of the model. Without any, fields appear in the order the model declares them.

Each item:

  • name — required · Name. How this arrangement is asked for, e.g. “web” or “print”. Unique within the form.
  • nodes — required · Nodes. What this arrangement places, in the order a person meets it.

One field of the form. Most fields collect a single answer; a group, a page and a repeater collect nothing themselves and hold other fields instead.

required · Key (see below) · max length 64 · pattern ^[A-Za-z_][A-Za-z0-9_]*$

Key. The name this field’s answer is stored under, and the field’s identity for as long as the form exists. It becomes a column in exported data and a variable in logic expressions, so it has to read like an identifier: a letter or an underscore, then letters, digits or underscores. Changing a key is a data migration rather than an edit, so say where it came from with “renamedFrom”. Two keys are refused: _id, which every repeater row carries its identity under, and __proto__, which every JavaScript object already has, so an answer stored under it would be lost.

Examples: "email", "invoice_total", "passengerCount"

required · Field type (see below)

Field type. What kind of answer the field collects, or — for a group, a page or a repeater — how it holds the fields inside it. The type decides which control the reader sees and how the answer is stored, so changing it on a live form may leave existing answers unreadable.

optional · boolean · default false

Required. Whether the form can be sent without an answer to this field — for a repeater, without a row. Turning this on for a field that already exists invalidates the submissions that left it empty, so publishing reports it as a lossy change.

optional · Key (see below) · max length 64 · pattern ^[A-Za-z_][A-Za-z0-9_]*$

Renamed from. The key this field used to be called. Set it in the same edit that changes the key and the answers already collected follow the field across. The old key must be gone from this form: if a field still uses it, you have made a copy rather than a rename, and the two would fight over the same answers.

Examples: "email", "invoice_total", "passengerCount"

optional · boolean · default true

Clear when hidden. What happens to an answer when a rule hides its field. On (the default), the answer is removed from the submission, so a hidden branch cannot carry data. Off, the answer is kept and comes back when the field reappears.

optional · Text (see below)

Label. What the person filling the form in reads next to this field, or a reference to it in the message catalogue.

optional · Text (see below)

Description. Help text under the question — “as on your passport” — read out with the control rather than as part of its name, so the label stays short. On a group, a page or a repeater it is read out with the whole set. Text, or a reference to it in the message catalogue. Needs spec version 5.

What kind of answer the field collects, or — for a group, a page or a repeater — how it holds the fields inside it. The type decides which control the reader sees and how the answer is stored, so changing it on a live form may leave existing answers unreadable.

  • "text" — Single-line text. One line of free text: a name, a reference, a short answer.
  • "textarea" — Multi-line text. A box several lines tall, for a message or a description.
  • "number" — Number. A numeric answer, for amounts and counts. Do not use it for phone numbers, postcodes or account numbers: those lose their leading zeros.
  • "checkbox" — Checkbox. A single yes-or-no answer, such as accepting the terms.
  • "select" — Dropdown. One answer picked from a list, shown collapsed. Best when the list is long.
  • "radio" — Radio buttons. One answer picked from a list, with every option visible at once. Best for a handful of options.
  • "selectboxes" — Checkboxes. Several answers picked from a list, every option visible at once. The answer is the list of values chosen, so an option removed later leaves the submissions that chose it unchanged.
  • "ranking" — Ranking. Options put in order of preference. The answer is the values of the options in the order chosen, most preferred first, and an option nobody ranked is not in it — so to ask for a complete order, set the fewest ranked to the number of options.
  • "matrix" — Matrix. One question asked of several rows, with the same answers for each — how was the taste, the delivery, the price. The answer holds the column chosen for each row answered, under the row’s value, so a row added later leaves the answers already collected as they were.
  • "date" — Date. A calendar date, with no time of day.
  • "time" — Time. A time of day, with no date and no time zone: opening hours, an appointment slot. Stored as “HH:MM” on a 24-hour clock, zero-padded — or, with a precision, with seconds and that many digits after them — so that every answer to the field has one width, and comparing two answers as text gives the same order as comparing them as times. Because it carries no zone it is not an instant and cannot be compared with the current time.
  • "datetime" — Date and time. One moment in time, stored as “YYYY-MM-DDTHH:MM:SSZ” — always UTC, always with seconds and, with a precision, that many digits after the seconds before the Z. A reader types and reads it in their own zone; the answer records the instant. Numeric offsets are refused because “…10:00:00+03:00” sorts after “…08:00:00Z” as text while being earlier in fact, and the ordering is what makes an earliest or latest bound mean anything.
  • "file" — File upload. One or more attached files. The submission stores what each file is and where it went — never its bytes — so a submission stays small and readable on its own.
  • "richtext" — Formatted text. Several lines of text the reader can emphasise, link and list. Stored as a restricted markup, not as HTML: nothing a reader writes is ever parsed as markup by the renderer, which is what keeps a submitted answer from becoming a script on the page that displays it.
  • "signature" — Signature. A mark somebody draws, or their name typed. Stored as points rather than as a picture, so it scales, diffs and means something to a reader that is not a browser — and never as stroke timing, which is what would make it biometric data.
  • "hidden" — Hidden value. Travels with the submission but is never shown to the reader, such as a campaign code or a referral source.
  • "static" — Static text. Text shown to the reader that collects nothing: a heading, an explanation, a notice.
  • "group" — Group. Related fields kept together on the same page. Collects nothing itself.
  • "page" — Page. One step of a form split over several screens. Collects nothing itself.
  • "repeater" — Repeater. A set of fields the reader can fill in more than once, such as one block per passenger. A repeater cannot be placed inside another repeater in this version of the spec.

Some properties only exist on some types. The schema states these as conditional blocks; they are listed here per type.

A group, a page or a repeater. It collects no answer of its own; the fields inside it do.

optional · Fields (see below)

Child fields. The fields held inside this container. Their keys are unique across the whole form, not just within the container.

Each item:

  • key — required · Key. The name this field’s answer is stored under, and the field’s identity for as long as the form exists. It becomes a column in exported data and a variable in logic expressions, so it has to read like an identifier: a letter or an underscore, then letters, digits or underscores. Changing a key is a data migration rather than an edit, so say where it came from with “renamedFrom”. Two keys are refused: _id, which every repeater row carries its identity under, and __proto__, which every JavaScript object already has, so an answer stored under it would be lost.
  • type — required · Field type. What kind of answer the field collects, or — for a group, a page or a repeater — how it holds the fields inside it. The type decides which control the reader sees and how the answer is stored, so changing it on a live form may leave existing answers unreadable.
  • required — optional · Required. Whether the form can be sent without an answer to this field — for a repeater, without a row. Turning this on for a field that already exists invalidates the submissions that left it empty, so publishing reports it as a lossy change.
  • renamedFrom — optional · Renamed from. The key this field used to be called. Set it in the same edit that changes the key and the answers already collected follow the field across. The old key must be gone from this form: if a field still uses it, you have made a copy rather than a rename, and the two would fight over the same answers.
  • clearOnHide — optional · Clear when hidden. What happens to an answer when a rule hides its field. On (the default), the answer is removed from the submission, so a hidden branch cannot carry data. Off, the answer is kept and comes back when the field reappears.
  • label — optional · Label. What the person filling the form in reads next to this field, or a reference to it in the message catalogue.
  • description — optional · Description. Help text under the question — “as on your passport” — read out with the control rather than as part of its name, so the label stays short. On a group, a page or a repeater it is read out with the whole set. Text, or a reference to it in the message catalogue. Needs spec version 5.

Every other type is an answer field: a field that collects one answer and holds no other fields.

select, radio, selectboxes, ranking, matrix

Section titled “select, radio, selectboxes, ranking, matrix”

optional · array of Option · at least 1 item

Options. The answers this field offers, in the order they appear.

Each item:

  • value — required · Value. What is stored in the submission when this option is chosen. Stable like a field key: changing it detaches the answers already collected.
  • label — required · Label. What the person choosing reads.
  • image — optional · Image. A picture shown with this option, on radio buttons and checkboxes — never in a dropdown, as a chip, in a ranking or in a matrix, which cannot show one, so the document is refused if it asks. The label still names the option and is what is announced; the picture is beside it. Needs spec version 4.
  • exclusive — optional · Only on its own. For a list of ticks: this option is chosen alone or not at all — “None of these”, “Prefer not to say”. Ticking it clears the others, ticking another clears it, and an answer holding it with anything else is refused, on the server too. On a list of ticks only: in a radio group or a dropdown every option already is. Needs spec version 5.
  • keepPlace — optional · Keeps its place. When the options are shuffled, this one stays where it is written — “None of these” last, “Other” after the rest. Needs spec version 5.

optional · integer · minimum 0 · maximum 1000

Minimum rows. How many rows the form opens with and will not go below: no row is removed past it, and a repeater a rule hid opens with it again. A repeater that promises one row shows one empty row, not an add button and a shrug.

optional · integer · minimum 1 · maximum 1000

Maximum rows. How many rows the repeater may hold. No add button is offered past it, and a submission with more rows is refused.

optional · string · min length 1 · max length 300

Add button label. The accessible name of the control that adds a row.

optional · string · min length 1 · max length 300

Remove button label. The accessible name of the control that removes a row. The renderer appends the row’s position, so a screen reader user hears which row a button kills.

optional · number

Minimum. The smallest value that counts as a valid answer.

optional · number

Maximum. The largest value that counts as a valid answer.

optional · number

Step. The granularity of the answer, and the distance a slider moves. Counted from the minimum when there is one, and from zero when there is not — so a step of 5 with a minimum of 2 accepts 2, 7 and 12. Must be greater than zero. Needs spec version 4.

optional · one of "rating", "slider"

Widget. How this field should look. Presentation only: it never changes what the field collects or what is stored. Leave it out for the default control. Show a scale of stars or numbers between the minimum and the maximum, or a track to drag. The answer is unchanged: still one number, and still subject to the minimum, maximum and step. Needs spec version 4.

optional · integer · minimum 0

Minimum length. The shortest answer that counts, in characters.

optional · integer · minimum 1

Maximum length. The longest answer that counts, in characters.

optional · string · min length 1 · max length 500

Pattern. A regular expression the whole answer must match, read as JavaScript reads one with the u flag: \p{L} is any letter, and a character outside the Basic Multilingual Plane is one character. Checked when the form is saved, so a broken or dangerous pattern never reaches a person filling the form in.

optional · one of "email", "url", "uuid"

Format. A named shape the answer must have. A closed list on purpose: each entry is one well-tested check, not a per-form regular expression.

Values of format:

  • "email" — Email address. One address, with a mailbox and a domain.
  • "url" — Web address. An absolute http or https URL.
  • "uuid" — UUID. A universally unique identifier in its canonical hex form.

optional · integer · minimum 0 · maximum 1000

Fewest choices. How many options must be ticked. Leave it unset to accept any number — and use required rather than a minimum of 1, so the reader is told the field is required before they touch it.

optional · integer · minimum 1 · maximum 1000

Most choices. How many options may be ticked at once.

optional · string · min length 1 · max length 64 · pattern ^[a-z][a-z0-9-]*$

Options source. Where this field’s answers come from, when there are too many to write into the form or they change too often. This is a NAME the deployment resolves to a list — never an address: the form never says where to look, so moving it between staging and production changes nothing here. The value that gets stored is a code only that source can decode, and a published version is frozen forever, so it has to still mean the same thing in a year. Leave it out and the field offers the options written above.

required · array · at least 2 items

optional · integer · minimum 0 · maximum 1000

Fewest ranked. How many options must be put in order. Set it to the number of options to ask for a complete order; leave it unset and any number may be ranked — use required rather than a minimum of 1, so the reader is told before they start.

optional · integer · minimum 1 · maximum 1000

Most ranked. How many options may be put in order, which is how “your top three” is asked.

required · array · at least 2 items

required · array of Row · at least 1 item

Rows. The things the question is asked of, one answer each. The options are the columns every row shares.

Each item:

  • value — required · Value. What the answer for this row is stored under. Stable like a field key: changing it detaches the answers already collected. Not __proto__, which every JavaScript object already has, so an answer stored under it would be lost.
  • label — required · Label. What the person answering reads for this row.

optional · array

Accepted file types. Media types or extensions, such as application/pdf or .png — the same grammar the HTML accept attribute uses, so the file picker filters on exactly what the server then enforces. A filter in the browser alone is a suggestion, not a rule.

optional · integer · minimum 1

Largest file. The size limit for one file, in bytes. The server checks it as well, because the browser cannot be trusted to.

optional · integer · minimum 0 · maximum 1000

Fewest files. How many files must be attached.

optional · integer · minimum 1 · maximum 1000

Most files. How many files may be attached.

optional · integer · minimum 1 · maximum 1000000

Longest answer. The cap on the answer, counted in characters of the stored markup rather than of the text a reader sees.

optional · one of "toggle"

Widget. How this field should look. Presentation only: it never changes what the field collects or what is stored. Leave it out for the default control. Show the tick-box as a switch. The answer is unchanged: still true, false, or untouched.

optional · one of "datagrid"

Widget. How this field should look. Presentation only: it never changes what the field collects or what is stored. Leave it out for the default control. Show the rows as a table with aligned columns instead of stacked blocks. The answer is unchanged.

optional · one of "typeahead"

Widget. How this field should look. Presentation only: it never changes what the field collects or what is stored. Leave it out for the default control. Let somebody type to narrow the options instead of scrolling them. The answer is still one of the options offered.

optional · string · min length 1 · max length 64 · pattern ^[a-z][a-z0-9-]*$

Options source. Where this field’s answers come from, when there are too many to write into the form or they change too often. This is a NAME the deployment resolves to a list — never an address: the form never says where to look, so moving it between staging and production changes nothing here. The value that gets stored is a code only that source can decode, and a published version is frozen forever, so it has to still mean the same thing in a year. Leave it out and the field offers the options written above.

optional · one of "scanner"

Widget. How this field should look. Presentation only: it never changes what the field collects or what is stored. Leave it out for the default control. Offer a camera route to a value somebody could otherwise type, such as reading a QR code. The answer is still the same string, and typing it must stay possible.

optional · string · min length 1 · max length 100

Input mask. The shape the answer is typed into, one character per position: 9 takes a digit, a a letter and * either, and any other character is written by the control rather than typed — (999) 999-9999. A backslash makes the next character one the control writes: \9. The answer holds only what was typed into the positions, so (999) 999-9999 stores 5551234567, and an answer that leaves a position empty is refused. Needs spec version 4.

optional · array · at least 1 item

Columns. Which of this grid’s fields become columns, and in what order. Leave it out to arrange every field in the order they are defined. A field left out is still collected and still shown, after the configured columns — a column list is an ordering, not a choice of which answers to keep.

Each item:

  • field — required · Field. The key of one of this grid’s own fields. A grid’s rows are flat, so it names a field that collects an answer — never a group holding more fields, which would put several controls in one cell under one heading that names none of them. Give each of those fields a column of its own, or take the grid off and the rows are stacked instead.
  • width — optional · Relative width. How much of the available width this column takes, relative to the others. A ratio rather than a measurement: a length in a document is one no renderer can honour on a narrow screen, and it would decide your design system for you. Zero is refused — a column nobody can see still holds a field that is collected and required-checked.
  • align — optional · Alignment. Which edge the values line up against. Numbers usually want the end.
  • header — optional · Column heading. A shorter heading for the column when the field’s own label is too long to sit above it. The field’s label is still what a screen reader announces for the control in the cell, so this shortens the heading without renaming the question.

optional · string · pattern ^\d{4}-\d{2}-\d{2}$

Earliest allowed. The earliest date this field accepts, inclusive, written exactly as an answer is: 2026-09-19. A fixed value, not an expression and not the current date — a bound that moved with the clock would let the same submission pass in the browser and fail on the server. For “must be in the future”, write a rule.

optional · string · pattern ^\d{4}-\d{2}-\d{2}$

Latest allowed. The latest date this field accepts, inclusive, written exactly as an answer is: 2026-09-19. A fixed value, not an expression and not the current date — a bound that moved with the clock would let the same submission pass in the browser and fail on the server. For “must be in the future”, write a rule.

optional · string · pattern ^(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d{1,9})?)?$

Earliest allowed. The earliest time this field accepts, inclusive, written exactly as an answer is, at the field’s width: 09:30 without a precision, 09:30:00 at precision 0, 09:30:00.000 at precision 3. A fixed value, not an expression and not the current time — a bound that moved with the clock would let the same submission pass in the browser and fail on the server. For “must be in the future”, write a rule.

optional · string · pattern ^(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d{1,9})?)?$

Latest allowed. The latest time this field accepts, inclusive, written exactly as an answer is, at the field’s width: 09:30 without a precision, 09:30:00 at precision 0, 09:30:00.000 at precision 3. A fixed value, not an expression and not the current time — a bound that moved with the clock would let the same submission pass in the browser and fail on the server. For “must be in the future”, write a rule.

optional · integer · minimum 0 · maximum 9

Precision. How many digits follow the seconds in the answer, from 0 to 9, counted as a database counts them in timestamp(p). Absent: a time is stored as 09:30 and a date and time as 2026-10-08T09:30:00Z, and the control is the browser’s, to the minute. 0: a time is stored as 09:30:00 and a date and time as 2026-10-08T09:30:00Z, and the control is typed, to the second. 1 to 9: that many digits follow the seconds, always all of them and never abbreviated, as 09:30:00.123 or 2026-10-08T09:30:00.123Z. The bounds are written at the same width. With a precision, a date and time on a day the calendar does not have, such as 30 February, is refused, which a field without one accepts as version 5 did. A rule comparing the field as text with a literal or another field not at its width is refused at publish, but one comparing through a list rule’s own variable, as steps.all(s, s.at >= startedAt), is not seen: give the fields compared there one precision, or, for two dates and times, compare them with timestamp(), which compares to the millisecond. Submissions already stored are never converted, so changing it leaves an earlier answer in the width it was written in. Needs spec version 6.

optional · string · pattern ^\d{4}-\d{2}-\d{2}T(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d{1,9})?Z$

Earliest allowed. The earliest date and time this field accepts, inclusive, written exactly as an answer is, at the field’s width: 2026-09-19T08:00:00Z without a precision or at precision 0, 2026-09-19T08:00:00.000Z at precision 3. A fixed value, not an expression and not the current date and time — a bound that moved with the clock would let the same submission pass in the browser and fail on the server. For “must be in the future”, write a rule.

optional · string · pattern ^\d{4}-\d{2}-\d{2}T(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d{1,9})?Z$

Latest allowed. The latest date and time this field accepts, inclusive, written exactly as an answer is, at the field’s width: 2026-09-19T08:00:00Z without a precision or at precision 0, 2026-09-19T08:00:00.000Z at precision 3. A fixed value, not an expression and not the current date and time — a bound that moved with the clock would let the same submission pass in the browser and fail on the server. For “must be in the future”, write a rule.

optional · integer · minimum 0 · maximum 9

Precision. How many digits follow the seconds in the answer, from 0 to 9, counted as a database counts them in timestamp(p). Absent: a time is stored as 09:30 and a date and time as 2026-10-08T09:30:00Z, and the control is the browser’s, to the minute. 0: a time is stored as 09:30:00 and a date and time as 2026-10-08T09:30:00Z, and the control is typed, to the second. 1 to 9: that many digits follow the seconds, always all of them and never abbreviated, as 09:30:00.123 or 2026-10-08T09:30:00.123Z. The bounds are written at the same width. With a precision, a date and time on a day the calendar does not have, such as 30 February, is refused, which a field without one accepts as version 5 did. A rule comparing the field as text with a literal or another field not at its width is refused at publish, but one comparing through a list rule’s own variable, as steps.all(s, s.at >= startedAt), is not seen: give the fields compared there one precision, or, for two dates and times, compare them with timestamp(), which compares to the millisecond. Submissions already stored are never converted, so changing it leaves an earlier answer in the width it was written in. Needs spec version 6.

optional · value

optional · array · at least 2 items

Signing box. The width and height the points are recorded in — a coordinate space, not pixels on anybody’s screen. It belongs to the field rather than to each answer, so two signatures on one form are comparable and a stored one can be redrawn at any size.

optional · integer · minimum 1

Most points. How many points one answer may carry across all its strokes. An unbounded point list is a payload amplifier, so this has a ceiling like everything else here.

optional · one of "tagpicker"

Widget. How this field should look. Presentation only: it never changes what the field collects. tagpicker narrows a long list by typing and shows the answers as chips; the answer is still an array of offered option values, in the options’ own order.

optional · one of "name", "honorific-prefix", "given-name", "additional-name", "family-name", "honorific-suffix", "nickname", "username", "organization-title", "organization", "street-address", "address-line1", "address-line2", "address-line3", "address-level4", "address-level3", "address-level2", "address-level1", "country", "country-name", "postal-code", "transaction-currency", "transaction-amount", "language", "bday", "bday-day", "bday-month", "bday-year", "sex", "url", "photo", "tel", "tel-country-code", "tel-national", "tel-area-code", "tel-local", "tel-local-prefix", "tel-local-suffix", "tel-extension", "email", "impp"

Autofill. What the answer is, in the words browsers and assistive technology share — email, given-name, postal-code — so a browser can fill it in and a person’s own tools can mark it, as WCAG 1.3.5 asks of a field that collects information about the person filling the form in. One of the input purposes the standard names, except the password and payment-card ones: a form platform keeps its answers, and storing a card number or a password in a submission is not something to invite. On text, long text, number, date and choice fields. Needs spec version 5.

optional · Text (see below)

Placeholder. An example of the answer, shown in the empty box until somebody types — “079 123 45 67”. Never instead of a label: it disappears as soon as there is an answer, and many readers never announce it, so what the question asks belongs in the label and how to answer it in the description. On a masked field it replaces the shape the control would show. Text, or a reference to it in the message catalogue. On text, long text and number fields. Needs spec version 5.

text, textarea, hidden, date, time, datetime, select, radio

Section titled “text, textarea, hidden, date, time, datetime, select, radio”

optional · string · min length 1

Default. The answer this field starts with in a new form — “CH”, 2, true, or the options a list of ticks starts ticked. An answer like any other: it is submitted unless somebody changes it, so make it the answer most people give, never a guess for them to correct. Stored as written, and not translated. A new row starts with it, and so does a field shown again after a rule hid and cleared it; a resumed draft, a prefill and the server’s replay of a submission start as they were handed in. The form refuses to open with one the field itself would refuse — not an option, out of bounds, the wrong shape. On text, long text, hidden, number, tick box, date, time, date and time, and choice fields. Needs spec version 5.

optional · number

Default. The answer this field starts with in a new form — “CH”, 2, true, or the options a list of ticks starts ticked. An answer like any other: it is submitted unless somebody changes it, so make it the answer most people give, never a guess for them to correct. Stored as written, and not translated. A new row starts with it, and so does a field shown again after a rule hid and cleared it; a resumed draft, a prefill and the server’s replay of a submission start as they were handed in. The form refuses to open with one the field itself would refuse — not an option, out of bounds, the wrong shape. On text, long text, hidden, number, tick box, date, time, date and time, and choice fields. Needs spec version 5.

optional · boolean

Default. The answer this field starts with in a new form — “CH”, 2, true, or the options a list of ticks starts ticked. An answer like any other: it is submitted unless somebody changes it, so make it the answer most people give, never a guess for them to correct. Stored as written, and not translated. A new row starts with it, and so does a field shown again after a rule hid and cleared it; a resumed draft, a prefill and the server’s replay of a submission start as they were handed in. The form refuses to open with one the field itself would refuse — not an option, out of bounds, the wrong shape. On text, long text, hidden, number, tick box, date, time, date and time, and choice fields. Needs spec version 5.

optional · array

Default. The answer this field starts with in a new form — “CH”, 2, true, or the options a list of ticks starts ticked. An answer like any other: it is submitted unless somebody changes it, so make it the answer most people give, never a guess for them to correct. Stored as written, and not translated. A new row starts with it, and so does a field shown again after a rule hid and cleared it; a resumed draft, a prefill and the server’s replay of a submission start as they were handed in. The form refuses to open with one the field itself would refuse — not an option, out of bounds, the wrong shape. On text, long text, hidden, number, tick box, date, time, date and time, and choice fields. Needs spec version 5.

optional · boolean

Shuffled order. Shows the options in an order of their own for each person who opens the form, so the first is not chosen for being first. Options that keep their place — “None of these”, “Other” — stay where they are written. Presentation only: the answer is the same values, stored in the options’ written order. On a radio group, a list of ticks and a ranking; a dropdown’s order is how a long list is searched, and a matrix’s columns are a scale. Needs spec version 5.

Every rule of the form, in one flat list. A rule names the field it applies to; the order here does not matter, because evaluation order comes from what depends on what.

One piece of behaviour, attached to one field.

required · string · min length 1 · max length 512

Target field. The data path of the field this rule applies to, e.g. “email”, “address.city”, or “items[].qty” for a field inside a repeater row.

required · one of "visible", "disabled", "required", "computed", "validate", "check", "skip"

Kind. What the rule decides about its field.

optional · string · min length 1 · max length 2000

Expression. The rule itself, in the Common Expression Language. It may read other fields by their data paths; what it reads is what it reacts to.

optional · string · min length 1 · max length 64

Error code. For a validate rule: the machine-readable code the field carries while the check fails — what a submission’s report says. What a person reads is the rule’s message, in the form’s language; a rule with none has its code said as it is written.

optional · Text (see below)

Message. For a validate rule: what the person reads while it fails — “Travellers must be 18 or older.” — in place of its code. Say what to do, not only what is wrong. Text, or a reference to it in the message catalogue, so it is read in the form’s language, and said for the rule’s code wherever the field carries it, a verdict from the server included. Needs a code, and no other rule on the field may share it. Needs spec version 5.

optional · value

Editor state. What the visual rule editor last knew about this rule. Regenerated from “cel” when possible; never evaluated. The expression is the single source of truth.

optional · one of "both", "client", "server" · default "both"

Runs on. Where a validation check runs. Some checks only make sense in one place — a uniqueness check needs the database, a typing hint needs the keyboard. Only a validate rule may set this: if visibility or requiredness differed between the browser and the server, the server could no longer check what the browser did. The default below is the one a VALIDATE rule gets; a check gets its own, stated on the check branch.

optional · string · min length 1 · max length 128 · pattern ^[a-zA-Z][a-zA-Z0-9_.-]*$

Check name. The name of a validator the deployment answers, for a check rule. A NAME and never an address: a URL here would be a deployment detail in a portable format, frozen forever in a published version, and a way to make an instance inside a private network fetch something for you.

  • "visible" — Visible. Shows the field while the expression is true. A hidden field is not validated, and by default its answer is removed from the submission.
  • "disabled" — Disabled. Greys the field out while the expression is true. A disabled field keeps its answer and stays visible.
  • "required" — Required. Makes the field required while the expression is true, on top of any fixed required flag in the model.
  • "computed" — Computed. Writes the expression’s result into the field whenever something it reads changes, and nothing else writes the field: a value typed into it, set on it or handed in with the form is not kept, on the server either. While the expression cannot be evaluated — an input it reads is still empty — the field keeps what the rule last wrote, or stays empty. A text, paragraph, number, date or time box draws the field read-only, so it can still be reached and read. Any other control is drawn as usual and does not keep a change made in it; add a disabled rule to grey it out.
  • "validate" — Validate. Checks an answer. While the expression is false, the field carries the error named by “code”. A field can have any number of these.
  • "check" — Check. Asks the deployment about an answer — whether this email is already registered, whether this reference exists. The rule names a check rather than carrying an expression, and the deployment answers it; nothing in formancy fetches anything. Needs spec version 3.
  • "skip" — Skip. Walks past a page while the expression is true — a visa page for somebody who does not need a visa. Its target is the PAGE’s key rather than a data path, because a page carries no answer of its own. The fields on a skipped page are hidden, as a visible rule hides one, so not validated, and each field, group and list on it is left out of what a response stores unless its own clearOnHide is false. The answers stay in the form’s value while the page is away, and every rule reads them, so walking back into it finds them. Needs spec version 3.

Some of a rule’s properties depend on its kind. The schema states these as a conditional block; they are listed here per kind.

Requires check. cel is not allowed here.

optional · value · default "server"

Runs on, for a check. A check defaults to server, and not to both the way a validate rule does. Only the server can always answer one — a browser can only ask if its host supplied a checker — so a check that did not say would fail closed on a page nobody had wired up. A host that CAN answer in the browser says both; until it does, the check runs at submit and nowhere else.

Requires cel. check is not allowed here.

message is not allowed here.

The remaining definitions the properties above refer to.

max length 128 · pattern ^[A-Za-z0-9][A-Za-z0-9._-]*$

A short URL-safe name: letters, digits, dots, dashes and underscores, beginning with a letter or a digit.

Examples: "contact-us", "expense-claim"

The data contract of the form: its fields, and the names their answers are stored under. Presentation and conditional logic live outside the model, which is why one model can be shown in more than one way.

required · Fields (see below)

Fields. The fields of the form, in the order the reader meets them. Order is presentation: a field is identified by its key, so moving one up or down does not change the data you have already collected.

Each item:

  • key — required · Key. The name this field’s answer is stored under, and the field’s identity for as long as the form exists. It becomes a column in exported data and a variable in logic expressions, so it has to read like an identifier: a letter or an underscore, then letters, digits or underscores. Changing a key is a data migration rather than an edit, so say where it came from with “renamedFrom”. Two keys are refused: _id, which every repeater row carries its identity under, and __proto__, which every JavaScript object already has, so an answer stored under it would be lost.
  • type — required · Field type. What kind of answer the field collects, or — for a group, a page or a repeater — how it holds the fields inside it. The type decides which control the reader sees and how the answer is stored, so changing it on a live form may leave existing answers unreadable.
  • required — optional · Required. Whether the form can be sent without an answer to this field — for a repeater, without a row. Turning this on for a field that already exists invalidates the submissions that left it empty, so publishing reports it as a lossy change.
  • renamedFrom — optional · Renamed from. The key this field used to be called. Set it in the same edit that changes the key and the answers already collected follow the field across. The old key must be gone from this form: if a field still uses it, you have made a copy rather than a rename, and the two would fight over the same answers.
  • clearOnHide — optional · Clear when hidden. What happens to an answer when a rule hides its field. On (the default), the answer is removed from the submission, so a hidden branch cannot carry data. Off, the answer is kept and comes back when the field reappears.
  • label — optional · Label. What the person filling the form in reads next to this field, or a reference to it in the message catalogue.
  • description — optional · Description. Help text under the question — “as on your passport” — read out with the control rather than as part of its name, so the label stays short. On a group, a page or a repeater it is read out with the whole set. Text, or a reference to it in the message catalogue. Needs spec version 5.

A list of fields.

max length 64 · pattern ^[A-Za-z_][A-Za-z0-9_]*$

The name this field’s answer is stored under, and the field’s identity for as long as the form exists. It becomes a column in exported data and a variable in logic expressions, so it has to read like an identifier: a letter or an underscore, then letters, digits or underscores. Changing a key is a data migration rather than an edit, so say where it came from with “renamedFrom”. Two keys are refused: _id, which every repeater row carries its identity under, and __proto__, which every JavaScript object already has, so an answer stored under it would be lost.

Examples: "email", "invoice_total", "passengerCount"

One answer a select, radio or checkbox field offers.

required · string · min length 1 · max length 200

Value. What is stored in the submission when this option is chosen. Stable like a field key: changing it detaches the answers already collected.

required · Text (see below)

Label. What the person choosing reads.

optional · object

Image. A picture shown with this option, on radio buttons and checkboxes — never in a dropdown, as a chip, in a ranking or in a matrix, which cannot show one, so the document is refused if it asks. The label still names the option and is what is announced; the picture is beside it. Needs spec version 4.

optional · boolean

Only on its own. For a list of ticks: this option is chosen alone or not at all — “None of these”, “Prefer not to say”. Ticking it clears the others, ticking another clears it, and an answer holding it with anything else is refused, on the server too. On a list of ticks only: in a radio group or a dropdown every option already is. Needs spec version 5.

optional · boolean

Keeps its place. When the options are shuffled, this one stays where it is written — “None of these” last, “Other” after the rest. Needs spec version 5.

Points at an entry in the message catalogue instead of spelling the text out here, so the same form can be read in more than one language.

required · string · min length 1 · max length 200

Message id. The key this text is stored under in every locale.

Something a person reads: either the words themselves, or a reference into the message catalogue.

The words of the form, kept apart from its structure so the same form can be published in several languages without duplicating it.

required · string · min length 2 · max length 35

Default locale. The language every message must exist in. Other languages may be incomplete; a missing translation falls back to this one rather than showing an id.

required · object

Catalogues. One catalogue per language, each mapping a message id to the words a person reads.

Either one field placed on the page, or a container holding more nodes.

required · the constant "field"

Kind. Marks this node as placing a single field.

required · string · min length 1 · max length 512

Field path. The data path of the field to place here, e.g. “email” or “address.city”.

optional · value

Column span. How many of the surrounding table’s columns this takes. Only inside a table: elsewhere it is refused rather than ignored. Use “all” for the full width — it is what somebody means and it survives a change to the column count, where a number does not. Anything a person works inside rather than answers in a word — a rich text editor, a file dropzone, a long text area — usually wants the full width.

required · one of "section", "row", "column"

Kind. How the children are arranged: stacked under a heading, side by side, or in a column.

optional · Text (see below)

Heading. Optional heading for the group.

required · array of Layout node

Children. The nodes inside this group.

optional · value

Column span. How many of the surrounding table’s columns this takes. Only inside a table: elsewhere it is refused rather than ignored. Use “all” for the full width — it is what somebody means and it survives a change to the column count, where a number does not. Anything a person works inside rather than answers in a word — a rich text editor, a file dropzone, a long text area — usually wants the full width.

required · the constant "tabs"

Kind. Shows one child at a time behind a row of tabs. Presentation only: every field in every tab is still validated and submitted, unlike a page.

optional · Text (see below)

Name of the tab strip. Names the strip itself, not a tab. Two sets of tabs in one form are otherwise both announced as “tab list”, and somebody using a screen reader cannot tell which is which.

required · array of Layout node · at least 1 item

Tabs. One section per tab. Each section’s heading is its tab’s name, so every one of them needs a heading — a tab with no name is a tab nobody can choose.

optional · value

Column span. How many of the surrounding table’s columns this takes. Only inside a table: elsewhere it is refused rather than ignored. Use “all” for the full width — it is what somebody means and it survives a change to the column count, where a number does not. Anything a person works inside rather than answers in a word — a rich text editor, a file dropzone, a long text area — usually wants the full width.

required · the constant "table"

Kind. A grid whose columns line up across every row, which stacked rows cannot do — each row sizes itself on its own.

required · integer · minimum 1 · maximum 12

Columns. How many columns at full width. Narrower than that and it collapses to one, so the form still works at 320 pixels without sideways scrolling.

optional · Text (see below)

Heading. Optional heading for the grid.

required · array of Layout node

Cells. The nodes to place, filling the columns in order.

optional · value

Column span. How many of the surrounding table’s columns this takes. Only inside a table: elsewhere it is refused rather than ignored. Use “all” for the full width — it is what somebody means and it survives a change to the column count, where a number does not. Anything a person works inside rather than answers in a word — a rich text editor, a file dropzone, a long text area — usually wants the full width.

A machine-readable code drawn from a value the form already holds — a booking reference as a QR code, say. It collects nothing: there is no answer and no key, which is why it is an arrangement rather than a field. A reader that cannot draw a code shows the value as text rather than a broken picture.

required · the constant "qrcode"

Kind. Marks this node as a code drawn from an answer.

required · string

Path. The data path of the answer to encode. The field must exist — a node that encodes nothing draws an empty box, which reads as a broken form rather than a typo in the arrangement.

optional · Text (see below)

Label. What a reader is told this code IS. Required, because it is the code’s accessible content: the picture is decoration a screen reader cannot use, and the value beneath it is a bare string — a booking reference announced with nothing to say what it is. Not the field’s own label, which names the control somewhere else on the page.

optional · value

Column span. How many of the surrounding table’s columns this takes. Only inside a table: elsewhere it is refused rather than ignored. Use “all” for the full width — it is what somebody means and it survives a change to the column count, where a number does not. Anything a person works inside rather than answers in a word — a rich text editor, a file dropzone, a long text area — usually wants the full width.

One arrangement of the model. A form may have several over the same data — a web layout and a print layout collect identical answers.

required · string · min length 1 · max length 64

Name. How this arrangement is asked for, e.g. “web” or “print”. Unique within the form.

required · array of Layout node

Nodes. What this arrangement places, in the order a person meets it.

min length 1 · max length 65536 · pattern ^(https://[^\s]+|/[^/\s][^\s]*|data:image/(png|jpeg|gif|webp|avif|svg\+xml)[;,].+)$

Where the picture comes from: an https:// address, a path starting with / on the site that shows the form, or the picture itself as a data:image/ address. Not http://, which a secure page blocks, and not a script. An address on another site tells that site who opened the form; a picture the form carries itself tells nobody.

One thing a matrix asks its question of.

required · string · min length 1 · max length 200

Value. What the answer for this row is stored under. Stable like a field key: changing it detaches the answers already collected. Not __proto__, which every JavaScript object already has, so an answer stored under it would be lost.

required · Text (see below)

Label. What the person answering reads for this row.