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
  • External variable setup
  • Settings
  • Is array
  • Required
  • Keep in URL if present on load
  • Storing answers in cookies
  • Default value
  • Prevent Editing

Was this helpful?

  1. Building flows
  2. Variables (answers)

Externally provided variables

Capture values passed into flows, even if not collected in questions (also known as hidden fields).

PreviousVariables from questionsNextCalculated variables

Last updated 5 months ago

Was this helpful?

There are many cases where you might want to pass data into a form that would never be provided by the responder directly, like:

  • tracking information, such as unique identifiers, account IDs, etc;

  • configuration variables, which enable or disable certain functionality.

External variables are created in Formsort to capture parameters that are passed into a flow via the URL.

Consult the page for more information on the proper format and other details.

If you're familiar with HTML form semantics, this is the equivalent of a <input type="hidden"> field which is part of a form, but not provided by the user.

Much like a variable provided by a user, external variables can be used in , , and in functions for .

External variable setup

To use an external variable for URL parameter capture, in the Variables tab, select Externally provided > Add External Variable, and set the name of the expected URL parameter in the Variable name field.

For example, if a user is being directed into your Formsort flow with utm_source as a URL parameter, the URL will look something like this:

https://<YOUR_FLOW_URL>/?utm_source={{example_utm_value}}

In order for Formsort to capture the value of utm_source, you need to create an external variable called utm_source. This variable will automatically store the value of the URL parameter when the flow loads.

Settings

Is array

Required

When the Required field is enabled, two things will happen when the external variable is not passed in to a user session:

  • A warning will be logged to the browser console during the user session; and

The externalVarIssues field is an object; see example:

"externalVarIssues":{"ext_var_name":"missing"}

Keep in URL if present on load

If you would like instead for a variable value to remain in the URL, enable Keep in URL if present on load. This might be helpful if you are matching up campaigns on a URL string, and want to keep things like the utm_source consistent across pages.

Anything in the URL will most likely be recorded by any analytics scripts you include in the integrations, so avoid enabling this setting for variables that set personally-identifying information.

Storing answers in cookies

Another option is to store answers in cookies. In cases where you are collecting more sensitive information, this might be a better option, since you might not want to pass sensitive information unencrypted via URL. In order to do so, you can enable Read/Write in Cookie option.

Configuring a domain is required to store answers in cookies.

Default value

When a default value is set, if a value is not present when a flow is loaded, the default value will be used.

A common use for this is to define control variables, similar to constants, that govern what parts of a flow are enabled, or function as a setting parameter.

Prevent Editing

By default, external variables passed in as query parameters can be overridden in the flow. If, for example, zip_code is passed in as a query parameter, but a question then asks the user to enter their zip code to a variable zip_code, the external answer will be replaced by the submitted answer. If you want to ensure external answers passed in as query params cannot be overriden, enable the Prevent Editing? option.

Prevent editing can also be used to persist external variables that are read from/written to cookies, when "start each session as a new responder" is enabled.

External variables are automatically included in answers payload delivery, if they are provided in the URL at flow load. No further configuration is needed once the form is deployed with the update

Use the Is array option if the field passed into the flow has an array format. For more information on the accepted query parameter convention, see .

An error field called externalVarIssues will be submitted in the flowLoaded event answer payload. This second point requires having an set up.

When a flow is loaded in Formsort, any URL parameters that match any variable defined in the flow will be placed into the variables and removed from the URL. To learn more about that, read about getting data in from .

Take care when "start each session as a new responder" is enabled in your , as the setting will remove Formsort-related cookies by default. See the Prevent Editing option below to guard against this.

Read more about start each session as a new responder .

๐Ÿ—๏ธ
๐Ÿ™Œ
URL parameters
Variant Settings
URL parameters
variable templating
conditional logic
locally-calculated variables
here
URL parameters
analytics integration
Create an external variable called utm_source. See settings below