LogoLogo
Back to studio
  • Formsort documentation
  • โฉQuickstart
    • ๐ŸŸขGet started with Formsort
    • ๐ŸŽCore concepts
    • โ„น๏ธQuestion and content reference
    • ๐Ÿ“•Key terms
    • ๐Ÿž๏ธCreate your first flow
    • ๐Ÿ“–Add content and collect answers
      • ๐ŸคณCapture demographic data
      • โ„น๏ธAdd informational content
      • ๐Ÿ” Review your variable schema
    • ๐ŸŽจCreate a theme
      • Set brand guidelines
    • ๐ŸคนPersonalize your flow
      • ๐ŸŒŸTemplate your variables
      • ๐Ÿง Add conditional logic
      • ๐Ÿ’ซUsing conditional logic with Calculated and API variables
      • ๐Ÿ”šEnd the flow
    • ๐Ÿ”€Set up integrations
    • ๐Ÿš€Go live
      • Auditing your flow for content, functionality, and design
    • ๐Ÿ’ผCommon use cases
      • ๐Ÿ’”Disqualify responders
      • ๐Ÿ—“๏ธAdd a scheduling option
      • ๐Ÿ“„Allow responders to read and accept your company policies
  • ๐Ÿ—๏ธBuilding flows
    • Flows and variants
      • Flow starts
    • Adding content
      • Groups
      • Steps
        • Settings
        • Logic
        • Style
      • Questions
        • General Settings
        • Style
        • Address
        • Comparison
        • Confirmation
        • Date
        • Date & Time
        • Email address
        • File upload
        • Grid choice
        • Iframe
        • Image upload
        • Number
        • Payment
        • Phone number
        • Postal code
        • Question group
        • Region
        • Select
          • Providing choices via API or calculation
        • Signature
        • SSN
        • Text questions
        • Yes/No
      • Content
        • General Settings
        • Statement
        • Image
        • Video
        • Next button
        • Divider
        • Map
      • Endings
      • Using markdown
      • Using variable templating
        • Template formatting functions
      • Copy-pasting form content
      • Content library
    • Conditions and logic
      • Logical operator reference
      • Advanced logic
    • Variables (answers)
      • Variables from questions
      • Externally provided variables
      • Calculated variables
      • API lookups
      • System Library variables
      • Orphaned variables
    • Schemas
      • JSON Schemas
      • Validating flow schemas
    • Redirects
    • Styling and themes
      • CSS Reference
      • Overriding theme styling
      • Custom CSS overrides
      • Content area
      • Animations and transitions
      • Form Layout
      • Typography
        • Adobe Fonts
        • Hosting custom fonts
      • Color variables
      • Dimension variables
      • Question containers
      • Assets
      • Form Buttons
        • Select buttons
      • Inputs and dropdowns
      • Checkmarks
      • Tables
      • Sliders
      • Divider lines
      • Progress bar
      • Comparison cards
    • Variant settings
      • Form behavior for returning responders
      • Group ranking API
    • Publishing and versions
      • Preview window
      • Deploying
      • History
  • ๐Ÿ’พHandling data
    • Philosophy and data retention policy
    • Viewing form answers
    • Responder UUIDs
    • Environments
      • Loading different environments
    • Passing data in
      • URL parameters
      • POST body
      • Embed query parameters
    • Custom validators
    • Form answers and events
      • Analytics events
      • Signed requests
      • Event payload shape
      • Submission frequencies
      • Runtime error reporting
      • Admin API
      • Flow content data format
    • Integration reference
      • Amplitude
        • Amplitude cross domain tracking
      • BigQuery
      • FullStory
      • Google Analytics
        • Updating from Universal Analytics to GA4
      • Google Cloud Storage
      • Google Sheets
      • Google Tag Manager (GTM)
        • JavaScript triggered by flow events
      • Hubspot
      • Jornaya
      • Optimizely
      • PostgreSQL
      • Redshift
      • Rudderstack
      • S3
      • Salesforce
      • Segment
        • Segment Setup
        • Segment cross domain tracking
      • Stripe
      • TrustedForm
      • Webhooks
        • Zapier
  • ๐Ÿ“บGoing live
    • Custom domains
    • Built-in analytics
    • Embedding
      • Web-Embed API
        • React-embed
      • Adding authentication
      • Embedding forms in iOS and Android
      • Setting up a dev environment
    • Split testing
    • Preflight checklist
  • ๐ŸขTeams
    • Accounts
      • Roles and permissions
    • Events subscriptions
    • Workspace domain detection
Powered by GitBook
On this page
  • Defining flow schemas
  • Verifying that a flow conforms to a schema
  • Missing values
  • Incorrectly-typed values
  • Updating a flow schema
  • Additive changes
  • Breaking changes
  • Schema events
  • Disabling a flow schema

Was this helpful?

  1. Building flows
  2. Schemas

Validating flow schemas

Ensure form variants stay conformant to a defined schema.

PreviousJSON SchemasNextRedirects

Last updated 6 months ago

Was this helpful?

Flow schemas allow you to define sets of answers that must appear within a flow. If any of the answers are missing, or are of the wrong type, content authors will be prevented from deploying.

As an example, if you have an onboarding flow, it is likely that a downstream consumer of the flow's information would consume a specific set of required fields, such as user_name, email, date_of_birth, etc. A flow schema for this object can be made, capturing that external dependency.

This gives developers working with teams that use Formsort confidence that less-tech savvy content authors do not accidentally remove critical information from a form flow while they make changes and run experiments. can be further used to enforce that users don't make changes they should not be able to make.

Defining flow schemas

To add a schema, first, go to the SCHEMAS tab within a flow:

Then, name your schema. Here we create a schema that will contain all the information that we need to create an account:

Once a schema is created, a new revision can be made. Here, the properties that the schema requires can be defined:

At this point, the schema has been defined, and is enabled by default.

Here, it's possible to view the schema in Typescript...

interface AccountInfo {
  first_name: string;
}
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "AccountInfo",
  "description": "Everything needed to create an account",
  "type": "object",
  "required": [
    "first_name"
  ],
  "properties": {
    "first_name": {
      "type": "string"
    }
  }
}

Verifying that a flow conforms to a schema

Once a schema has been defined and is enabled, any attempt to publish any variant within the flow must conform to all schemas defined within.

Missing values

If a flow does not collect an answer, deployment will be prevented:

Incorrectly-typed values

If a flow contains an answer keyed with one of the schema properties, but the answer is not of the correct type, deployment will be blocked:

Keep in mind that partials of the schema values may be sent as the responder completes the flow - since questions collecting the answers can be spread across multiple steps.

Updating a flow schema

Since deployment of Formsort revisions cannot be precisely timed with the deployment of downstream services that consume data from Formsort, for maximum safety, the process of updating a schema should proceed as follows:

  • Define a new revision of the schema.

  • Deploy all variants compliant to the new schema.

    • These variants should be compliant with both new and old revisions of the schema. Use calculated variables if you need to alias any fields.

  • Remove support for the previous revision of the schema from downstream services.

  • Disable the previous revision of the schema.

  • Republish any variants

Additive changes

Adding a property to an existing schema is a non-breaking change: existing consumers will be happy, since they can be unaware of the new property.

Changes like this represent minor version updates (0.1 -> 0.2)

Breaking changes

Removing a property, or changing its type, is a breaking change: existing consumers may break, since they expect the value to be present or typed a certain wait.

Changes like this represent major version updates (0.1 -> 1.0)

Schema events

Coming soon!

In the future, we will emit events whenever a schema's fields become completed, change, or become incomplete.

Disabling a flow schema

If you no longer need to enforce a schema, disable each of the schema's revisions.

... as well as formats.

To help with schemas that evolve over time, schema revisions are versioned using .

๐Ÿ—๏ธ
JSON schema
semantic versioning
Roles and permissions