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
  • Content order and conditional logic
  • Simple logic editor
  • Advanced logic
  • Optional?
  • Logical operator reference

Was this helpful?

Controlling the flow with conditions and logic

Modify your flow's behavior using answers collected.

PreviousMapNextAdvanced logic

Last updated 2 days ago

Was this helpful?

Conditional logic allows you to create dynamic, personalized flows without duplicating efforts across multiple form versions. You can use logic to control when certain elements appear based on responder inputs.

Logic can be applied to:

  • , , or


Content order and conditional logic

Responders experience the flow according to the step order defined in the Content Editor—from Step 0 onward. Conditional logic doesn’t override this order, but it can hide or reveal elements based on logic that evaluates to true or false.

  • If the logic evaluates to true, the element is shown.

  • If it evaluates to false, the element is hidden.

Important: Logic does not skip responders to other steps. For example, applying logic to Step 30 will not cause the user to jump there from Step 1—they must progress sequentially unless explicitly redirected.

Example flow:

Step 1: Do you have a cat or a dog?

  • If the responder selects Cat: logic on Step 2 evaluates to true → Step 2 is shown, Step 3 is hidden.

  • If the responder selects Dog: logic on Step 2 evaluates to false → Step 2 is hidden, Step 3 is shown.

This simple pattern allows you to branch the experience without creating a separate flow.

Simple logic editor

The Simple Logic Editor enables basic conditional rendering using one or more logical arguments.

Each condition consists of:

  • A variable (e.g., answer, external variable)

  • A target value to compare against

Logic can only reference variables that are already defined earlier in the flow. You cannot apply logic to Step 1 based on a value defined in Step 3.

You can:

  • Add multiple conditions using + Add condition

  • Group conditions using + Add group for more complex logic

Advanced logic

Advanced logic allows you to create boolean expressions across multiple answers using a freeform logic editor.

For even more control, use a calculated variable that returns a true or false value using TypeScript. This boolean value can then be referenced by simple logic elsewhere in the flow.


Optional?

By default, Formsort flows require all questions to be answered before moving forward. Toggling on Optional? allows responders to skip a question.


Logical operator reference

Logical operators evaluate expressions to determine whether a question, step, or group should be enabled.

Operator
Description

Equals

The value exactly matches the expected value.

Does not equal

The value does not match. Also true if the value is undefined.

Greater than

The value is greater than the expected value. (Numbers only)

Less than

The value is less than the expected value. (Numbers only)

Matches regular expression

The value matches the regex pattern.

Does not match regular expression

The value does not match the regex pattern.

Is defined on load

The value was set via URL param, POST body, or similar on form load.

Is defined

Any value (including false) is present. Useful for gating logic.

Is not defined

The value has not been set.

Had a loading error

The value couldn’t be loaded or computed due to an error (e.g., API failure).

A logical operator (see the below)

If you find yourself needing more flexibility, consider using or the advanced logic editor.

calculated variables
operator reference
Questions
Steps
Groups
Calculated variables
API variables
Redirects
Using the simple logic editor to conditionally render the first step
Creating a two-argument AND statement in the logic editor