LogoLogo
Back to studio
  • 🧠Core Concepts
    • Introduction to Formsort
    • Formsort quickstart guides
      • Add content and collect answers
      • Capture demographic data
      • Add informational content
      • Template your variables
      • Add conditional logic
      • Using conditional logic with Calculated and API variables
      • Add a scheduling option
      • End the flow
      • Review your variable schema
      • Set up integrations
    • How data works in Formsort
      • Responder UUIDs
    • Understanding flows
    • Versioning in Formsort (Deploying)
      • Variant revisions
      • Managing revisions
  • ✨Creating Flows
    • Building a new flow
      • Groups
      • Steps
      • Copy-pasting form content
  • Adding questions and content
    • Questions
      • Select
      • Text
      • Address
      • Comparison
      • Confirmation
      • Date
      • Date & time
      • Email address
      • File upload
      • Grid choice
      • Iframe
      • Image upload
      • Number
      • Payment
      • Phone number
      • Postal code
      • Question group
      • Region
      • Signature
      • SSN
      • Yes/No
    • Content
      • Statement
      • Image
      • Next button
      • Video
      • Divider
      • Map
  • Controlling the flow with conditions and logic
    • Advanced logic
  • Variable templating
  • Redirects and endings
  • Field validation
  • Flow and variant management
  • Content library
  • 🧬JSON Form Definition
  • JSON schemas
  • Validating flow schemas
  • Events subscriptions
  • Flow content data format
  • 🎨Styling
    • Customizing appearance
      • Content area & form layout
      • Buttons
      • Typography
      • UI states
      • Color and dimension variables
      • Question containers
      • Inputs and dropdowns
      • Checkmarks
      • Tables
      • Sliders
      • Divider lines
      • Progress bar
      • Comparison cards
      • Animations and transitions
  • CSS & Advanced Styling
    • Custom CSS overrides
    • Step styling
    • CSS reference
  • 🔁Form Behavior Settings
    • Variant settings
      • Form behavior for returning users
      • Group ranking API
    • Navigation sidebar
  • ⚙️Response Data Collection & Management
    • Schema (variables)
      • Variables from questions
      • Externally provided variables
      • Calculated variables
      • API lookups
      • System Library variables
      • Orphaned variables
  • Saving & retrieving responses
  • Importing Data
    • URL parameters
    • POST body
    • Embed query parameters
  • 📊Analytics and Attribution
    • Built-in analytics
    • Split testing
  • 🚀Publishing and Deployment
    • Live preview overview
    • Environments
      • Loading different environments
    • Embedding
      • Web-embed API
        • React-embed
      • Adding authentication
      • Embedding forms in iOS and Android
      • Setting up a dev environment
    • Pre-deployment checklist
  • 📁Workspace Management
    • Accounts
      • Roles and permissions
    • Custom domains
    • Workspace domain detection
  • 🛠️Formsort Admin API
    • Admin API
  • 🔌Integrations
    • Form answers and events
      • Analytics events
      • Signed requests
      • Event payload shape
      • Submission frequencies
      • Runtime error reporting
    • 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
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?

Validating flow schemas

Ensure form variants stay conformant to a defined schema.

PreviousJSON schemasNextEvents subscriptions

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