Skip to main content

Schema & validation

One schema drives the form, the server checks, and the response view. Define it once and change it safely after launch.

Start from the schema shape

The editor, SDKs, API, validation, exports, and integrations share the schema saved in Fillo. Use the same form ID to pull its current definition and to embed its published version.

Every schema has version: 1, a title, at least one page, an ordered block list, and settings. Fields create answers. Content blocks shape the reading flow without adding answer keys.

saved form schema
{
  "version": 1,
  "title": "Tell us what happened",
  "pages": [
    {
      "id": "request",
      "blocks": [
        {
          "id": "topic",
          "kind": "select",
          "label": "What do you need help with?",
          "required": true,
          "options": [
            {
              "id": "billing",
              "label": "Billing"
            },
            {
              "id": "technical",
              "label": "Technical issue"
            }
          ]
        },
        {
          "id": "details",
          "kind": "long_text",
          "label": "Tell us more about {{topic}}",
          "required": true,
          "visibleIf": [
            {
              "fieldId": "topic",
              "op": "answered"
            }
          ]
        },
        {
          "id": "account_id",
          "kind": "hidden",
          "paramName": "account"
        }
      ]
    }
  ],
  "settings": {
    "showProgress": true,
    "saveProgress": true
  }
}

Treat every id as stored data

  • Pull and edit the same form ID. Preserve the base revision so another editor’s changes can be detected.
  • Page ids must be unique within the form. Block ids must be unique across every page because field ids become keys in ResponseData.
  • Choice option ids, ranking option ids, and matrix row and column ids are stored answer values. Labels may change without rewriting those values.
  • Ids are strings from 1 to 128 characters. Never derive them from array position, visible copy, translated labels, or a random value generated during render.
  • A schema supports 1 to 50 pages, up to 500 blocks per page, and up to 200 options, rows, or columns in one list.

Field kinds and answer shapes

Every field accepts id, label, optional description, required, placeholder, and visibleIf where those properties apply. The table adds each kind's stored answer shape and field-specific rules.

KindJSXStored answerValidation and configuration
short_textFillo.TextstringOptional maxLength; otherwise a 2,000 character safety cap.
long_textFillo.LongTextstringOptional maxLength; otherwise a 20,000 character safety cap.
emailFillo.EmailstringValid email syntax and optional maxLength.
urlFillo.UrlstringAn absolute http: or https: URL, with optional maxLength.
phoneFillo.Phonestring stored in E.164 formServer validation is authoritative; defaultCountry is a two-letter country code.
numberFillo.Numberfinite numberOptional min and max; numeric strings are normalized before validation.
selectFillo.Selectoption id or Other stringOne known option id, or one free-text value up to 500 characters when allowOther is on.
multi_selectFillo.MultiSelectstring[]Unique known option ids, plus at most one Other value when enabled.
dropdownFillo.Dropdownoption id or Other stringOne known option id, or one free-text value up to 500 characters when allowOther is on.
checkboxFillo.CheckboxbooleanRequired means the value must be true; appearance may be checkbox or toggle.
ratingFillo.Ratinginteger numberFrom 1 through max, which defaults to 5. CSAT requires a 1 through 5 scale.
linear_scaleFillo.Scaleinteger numberBetween min and max, defaulting to 1 and 10. NPS requires 0 through 10.
rankingFillo.Rankingordered string[]Every option id must appear exactly once.
matrixFillo.MatrixRecord<rowId, columnId>Only declared row and column ids; a required matrix needs an answer for every row.
signatureFillo.Signaturedata:image/... stringMust be an image data URL produced by the signature control.
dateFillo.DateYYYY-MM-DD stringMust be a real calendar date, not only a string with the right shape. defaultToday: true starts it on the respondent's own date, set by their device after the form loads; they can change it.
file_uploadFillo.FileUploadFileValue[]Completed file references only; maxFiles (default 1), maxFileSizeMb (per-file cap in MB, default 500), and accept are enforced.
hiddenFillo.HiddenstringFilled from paramName or defaultValue, never rendered, and never required.
calculatedFillo.Calculatednumber (server-computed)Derived from the calc expression over numeric fields; client-sent values are ignored and the server recomputes on submit. Never required.
repeating_groupFillo.RepeatingGroupGroupInstanceValue[], one object per instance keyed by child idInstance count must fall between minInstances (default 1) and the required maxInstances (1 to 20, a schema error outside that range); child fields are drawn from a restricted kind allowlist and a child's visibleIf may reference only another field in the same group. Never required: minInstances alone governs completeness.
customFillo.Customarbitrary JSONCore checks required presence only; the custom component owns richer validation.

Content blocks

Content blocks belong in the same ordered blocks array as fields. They need stable block ids for durable schema structure and may carry visibleIf, but they never create a response value.

KindJSXSchema contentBehavior
headingFillo.Headingtext: stringDisplays a heading and supports answer piping.
paragraphFillo.Paragraphtext: stringDisplays supporting copy and supports answer piping.
dividerFillo.DividerNo content propertyAdds a visual break and never creates an answer.

Read and write response data by field id

  • ResponseData is an object keyed by field id. Optional unanswered fields are absent; do not depend on every schema field having a key.
  • Choice fields store option ids. Use Fillo's formatting helpers or the response formatted payload when a destination needs labels.
  • Numbers, ratings, and scales are stored as numbers after normalization. Matrix answers map row ids to column ids. Files are arrays of completed file references.
  • A custom field may store any JSON value. Its renderer and your downstream code must agree on the shape.
  • Each response is anchored to the schema version it answered. The response grid and CSV retain removed field ids, while live integrations work from the current schema.

Validation runs at schema and response boundaries

  • Fillo normalizes and validates untrusted schemas before storing or rendering them. Invalid top-level shapes, unknown kinds, duplicate ids, invalid number ranges, and unsupported schema versions fail. Malformed field blocks such as a choice with no valid options are removed, and a schema with no valid block is rejected.
  • The client gives immediate field feedback, but the submission API validates the response again. Treat the server result as authoritative.
  • Only fields visible for the submitted answers are validated and retained. A stale answer from a field hidden by logic is removed from the accepted data.
  • Strings are trimmed except custom-field strings. Numeric strings are normalized for number, rating, and scale fields. Phone answers receive authoritative server validation and E.164 normalization.
  • File answers are accepted only after the upload protocol has created and verified the referenced file for the same form.

Model choices with stable option ids

  • Store machine-friendly option ids such as technical; show respondents changeable labels such as Technical issue.
  • allowOther stores the respondent's text directly when it is not a declared option id. Downstream code must handle both declared ids and free text.
  • shuffleOptions changes presentation order only. It does not change the option list or stored values.
  • A ranking answer contains every option id in respondent order. Adding or removing ranking options changes the required answer set.
  • Matrix rows and columns each have their own stable ids. A required matrix must contain one valid column id for every row.

Use visibleIf for conditional structure

Attach visibleIf to a field or content block. Every condition in the array must match, so multiple conditions use AND behavior. Reference the controller by field id and compare choice answers to option ids, not labels.

OperatorBehavior
eqExact value match; a multi-select matches when it contains the value.
neqThe field must be answered and different from the value.
containsCase-insensitive substring for text, or membership for an array.
gt / ltFinite numeric comparison, including numeric input strings.
answeredTrue when the effective value is not empty.
not_answeredTrue when the effective value is empty.

Pipe answers into respondent-facing copy

Use {{field_id}} in a field label or description, or in heading and paragraph text. Fillo substitutes the current answer for display only. Choice ids become option labels, arrays join with commas, and an unanswered field becomes an empty string.

Piping does not change stored answers and is not a templating or authorization system. Never put a secret in a schema and expect a conditional block or piping token to hide it from someone who can load the published schema.

Form settings and effects

Manage private mail and privacy controls in the authorized project. A browser placement reads the published form without editing any settings.

SettingEffectWhere to edit
hostedPageEnable a public Fillo page. New agent-created app forms default to false; existing forms keep their choice. Native collection does not require this page.Form definition
submitModeUse a normal submit button or eligible one-answer auto-submit behavior.Form definition
submitLabelOverride the default submit button label.Form definition
successTitleSet the success screen heading.Form definition
successMessageSet the success screen supporting copy.Form definition
redirectUrlSend the respondent to an absolute HTTP or HTTPS URL after success.Form definition
showProgressShow progress through a multi-page form.Form definition
responseLimitLimit repeats by browser, identifying field, or identify context.Form definition
trustHold submissions from unverified respondents for owner review (fail-closed).Form definition
notifyEmailEmail a workspace-selected address after a response.Form settings
notifyEmailIncludeAnswersCopy selected answers into team email (default off).Form settings
notifyEmailAnswerFieldsChoose which top-level answers may be copied into team email.Form settings
notifyEmailReplyToFieldSet the email field used for direct respondent replies.Form settings
sendReceiptSend a receipt to the first answered email field.Form settings
saveProgressPersist in-progress answers so a respondent can resume.Form definition
draftAnswersVisibleLet workspace members view saved, unsubmitted answer content.Form settings
resumeEmailsSend one resume link to an eligible respondent after abandonment.Form settings
resumeUrlChoose the HTTP or HTTPS page that receives an embedded resume link.Form settings
draftDigestSend daily drop-off counts and verified respondent context, never answer content.Form settings

Make version-safe schema changes

  1. Prefer additive optional fields

    An optional field does not block an older client or a respondent who never sees it. A new visible required field changes what a valid submission needs.

  2. Change copy without changing ids

    Labels, descriptions, placeholders, and option labels may evolve while stable ids preserve raw answers and downstream keys.

  3. Use a new id for a new answer shape

    Changing a field from select to multi_select, or reusing an old option id for a different meaning, makes one key represent incompatible data. Add a new field instead.

  4. Review logic and piping references

    When removing a field or option, search visibleIf, piping tokens, response limits, prefill, webhooks, exports, and destination mappings for its id.

  5. Stage and test the published path

    Save a draft with an authorized connection and test the conditional branches, validation, and uploads. Review the saved revision before publishing. Confirm the live form with an authorized test response.

Next steps

This page for agents: /docs/schema.md · index at /llms.txt

Updated

Was this page helpful?