Skip to content
Geecon Global
Book a consultation (opens in a new tab)
Menu

Form Builder docs

For developersv0.1.1 · Updated 26 Nov 2026

Data format

The stored definition and texts, field by field, for website developers.

This page is the reference for what Form Builder stores. For reading it in code, see Reading forms.

The Developer tab of any form shows its stored definition, a TypeScript type and a JSON Schema.

The Developer tab showing the form's definition as JSON: pages, then fields with their IDs, types and required flags.
The Developer tab showing the form's definition as JSON: pages, then fields with their IDs, types and required flags.
The Developer tab

The content type#

Field IDTypeTranslatedHolds
titleShort textNoThe editor-facing name of the entry
kindShort textNoform, block or template
definitionJSON objectNoThe structure: pages, fields, rules
textsJSON objectYesEvery visitor-facing text for one locale
linkedEntriesEntry linksNoMaintained by the app: the blocks and after-submit entry the definition refers to

Contentful returns non-translated fields under the default locale. With locale=* every field is keyed by locale code.

definition#

interface FormDefinition {
  version: 1;
  status: "open" | "closed";
  schedule?: { opensAt?: string; closesAt?: string }; // ISO date-times
  pages: { id: string; items: Item[] }[];
  afterSubmit: { type: "message" } | { type: "url"; url: string } | { type: "entry"; entryId: string };
  customProperties?: Record<string, string>;
  retiredFields?: { id: string; type: FieldType }[];
}
 
type Item = Field | LayoutItem | { type: "block"; id: string; entryId: string; showWhen?: ShowWhen };
 
interface Field {
  id: string; // the key of the answer. Locks after the first publish.
  type: FieldType;
  required?: boolean;
  validations?: Validations;
  options?: string[]; // option values for dropdown, radio and checkboxes. Labels are in texts.
  display?: "checkbox" | "switch"; // yesNo only
  prefill?: { source: "url" | "site"; key: string };
  hiddenValue?: string; // hidden fields
  autocomplete?: string; // an HTML autocomplete token, such as "given-name" or "postal-code"
  showWhen?: { field: string; values: (string | boolean)[] };
}
 
interface LayoutItem {
  id: string;
  type: "heading" | "paragraph" | "divider";
  showWhen?: ShowWhen;
}
 
type FieldType =
  | "shortText" | "longText" | "email" | "phone" | "number" | "url" | "date" | "time"
  | "dropdown" | "radio" | "checkboxes" | "yesNo" | "consent" | "hidden";
  • version is 1. A future change of format would raise it.
  • A form with schedule is open only between opensAt and closesAt. status: "closed" wins over the schedule.
  • retiredFields lists published fields that were removed. Their IDs can't be reused with another type.
  • A block entry (kind: "block") uses the same shape with exactly one page. Only pages[0].items and retiredFields matter.
  • A template entry (kind: "template") is a full definition plus texts.
  • autocomplete is unset by default. Render it as the input's autocomplete attribute. When it's unset, use email, tel and url for email, phone and web address fields.
  • The app keeps keys it doesn't know. An extra key, such as one your own tooling adds, stays when an editor saves.

validations#

KeyApplies toMeaning
minLength, maxLengthShort text, Long textNumber of characters
patternShort text"letters", "numbers", "lettersNumbers" or { "regex": "…" }
minDigits, maxDigitsPhoneDigits, not counting a leading +. Defaults 10 and 15
min, max, wholeNumberNumberLimits, and whole numbers only
minDate, maxDateDateYYYY-MM-DD or "today"
minTime, maxTimeTimeHH:mm
minItems, maxItemsCheckboxesNumber of choices

texts#

A flat object of keys to strings. Rich text keys hold a Contentful rich text document (bold, italic, lists and links only).

KeyHolds
form.titleThe form's title
form.introRich text
form.submit, form.next, form.backButton texts
form.closedRich text, for a closed form
form.requiredNoteExplains the * next to required fields
form.errorSummary.title, .bodyThe summary shown after a failed submit
afterSubmit.messageRich text, when afterSubmit.type is message
form.errors.<rule>The form-wide message for a rule. {limit} is a placeholder
page.<pageId>.titleA page title, for multi-page forms
<fieldId>.label, .placeholder, .helpA field's texts
<fieldId>.options.<value>The label of an option
<fieldId>.on, <fieldId>.offThe two answers of a Yes/No field
<fieldId>.errors.<rule>A message for one rule of one field
<itemId>.textA heading's text, or a paragraph's rich text

The rules are required, minLength, maxLength, pattern, email, phone, url, min, max, wholeNumber, minDate, maxDate, minTime, maxTime, minItems and maxItems.

The default locale holds every text. Other locales hold only the texts that were translated, so merge per key. See Translations.

Developer tab#

In an entry's Developer tab, the app shows the saved definition, the texts merged for a chosen locale, a TypeScript type for the submission, a JSON Schema (draft-07) for the submission and a merge snippet. Fields with a showWhen rule are optional in the type and the schema. Apply the rule before you validate stored data against them.

The JSON Schema applies the same rules as the Preview, with these details:

  • A required Yes/No or Consent field must be true. A required text field needs more than spaces, and required checkboxes need at least one choice.
  • A phone answer is digits with an optional leading +, within the field's digit limits (10 to 15 unless set).
  • A web address must start with http:// or https://.
  • A time is HH:mm, the value a time input sends.
  • Fixed earliest and latest dates use formatMinimum and formatMaximum. Validators such as Ajv need ajv-formats with its keywords turned on to check them; others ignore them.
  • today limits and earliest and latest times aren't in the schema. Check them in your own code, as the Preview does.
  • Leave blank optional answers out of the submission: the schema rejects an empty string for an email or web address.

Things to know#

  • If two people edit the same form at once, the last save wins. The app warns you when it keeps your version over a colleague's change; reload to see theirs.
  • Data written through Contentful's API bypasses the app. If you write definition yourself, follow the shape above and keep field IDs stable.
  • Contentful doesn't track links inside JSON. linkedEntries exists so it can. Don't edit it.