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
  • Sample form schemas
  • Accessing the JSON schema for a flow

Was this helpful?

JSON schemas

Exporting form payload metadata for validation or analysis.

PreviousContent libraryNextValidating flow schemas

Last updated 6 months ago

Was this helpful?

Every variant revision is available as a (Draft 07), which describes the possible answer payloads that a flow may produce. Exporting this JSON allows you to write validators on your end, or understand the possible payloads that a flow may produce using the many tools that use the JSON Schema format.

Sample form schemas

Each of these examples shows how a form that only collected a single answer would be respresented in a JSON schema

{
  '$schema': 'http://json-schema.org/draft-07/schema#',
  'type': 'object',
  'properties': {
    'user_fname': {
      'type': 'string',
      'description': 'The first name of the user'
    }
  }
}
{
  '$schema': 'http://json-schema.org/draft-07/schema#',
  'type': 'object',
  'properties': {
    'A choice': {
      'oneOf': [
        {'const': 'Value A'},
        {'const': 'Value B'}
      ]
    }
  }
}
{
  '$schema': 'http://json-schema.org/draft-07/schema#',
  'type': 'object',
  'properties': {
    'A choice': {
      'type': 'array',
      'items': {
        'oneOf': [
          {'const': 'Value A'},
          {'const': 'Value B'}
        ]
      }
    }
  }
}

Note that address is the only current object answer type with a distinct object type definition. Custom object types will be supported in the future.

{
   "$schema":"http://json-schema.org/draft-07/schema#",
   "type":"object",
   "definitions":{
      "address":{
         "type":"object",
         "properties":{
            "raw":{
               "type":"string"
            },
            "address_1":{
               "type":"string"
            },
            "address_2":{
               "type":"string"
            },
            "city":{
               "type":"string"
            },
            "state":{
               "type":"string"
            },
            "postal_code":{
               "type":"string"
            },
            "country":{
               "type":"string"
            }
         },
         "required":[
            "address_1",
            "city",
            "state",
            "postal_code"
         ]
      }
   },
   "properties":{
      "An address":{
         "type":"array",
         "items":{
            "$ref":"#/definitions/address"
         }
      }
   }
}

Note that none of the root object properties are marked required: if you are receiving events with answers on every step, you may receive partial payloads, so you cannot assume the presence of any answer.

Accessing the JSON schema for a flow

The JSON schema for a given flow, variant, and revision combination is available at the following URL:

https://variant.formsort.com/flow-api/client/{CLIENT_ID}/flow/{FLOW_LABEL}/variant/{VARIANT_LABEL}/revision/{VARIANT_REVISION_UUID}/schema.json
JSON schema