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
  • Use Single Field
  • International addresses
  • Setting Address via URL parameter
  • Autocomplete using Google Places API
  • Validating form addresses with USPS

Was this helpful?

  1. Adding questions and content
  2. Questions

Address

Collects an address, including street, state and postal code.

PreviousTextNextComparison

Last updated 10 days ago

Was this helpful?

Unlike most answers, a default address answer value is stored as an object, since it contains multiple parts.

{
  "my_address": {
    "address_1": "213 Main St",
    "address_2": "Apt 17",
    "city": "Kansas City",
    "state": "MO",
    "postal_code": "64116"
  }
}

Need only the town / city? See the question type.

If you would like to access one of the parts of the address in a string , you may use the get template function.

Given the above example, a template like:

Great, your postal code is {{my_address | get 'postal_code'}}.

Would render:

Great, your postal code is 64116

Use Single Field

When this option is enabled, Formsort will provide a single input field for the user address, rather than distinct input fields for street address, city, state, and zip.

The payload for a single field address is a little different than the default, since the data type is considered string instead of an address object. This means the address details will come in as one "raw" property in the address object.

{
  "my_address": {
    "raw": "213 Main St., Apt 17, Kansas City, MO 64116"
  }
}

International addresses

If you enable International?, then responders will be allowed to choose the country of their address. The saved address will contain the country that was selected.

{
  "my_international_address": {
    "address_1": "Strahovské nádvoří 301",
    "city": "Praha",
    "postal_code": "118 00"
    "country": "Czech Republic"
  }
}

Default

When international addresses are enabled, you can set a default country using Default country.

Setting Address via URL parameter

If you'd like to pass an address into the flow for your user, here is an example of the syntax required for the address component at the top of this section. Notice each [field] corresponds to an object key from the example.

You can set all the address fields, or just the fields you have (or want to use).

Default address component syntax:

https://your-flow-url.com?my_address[address_1]=213+Main+St&my_address[address_2]=Apt+17&my_address[city]=Kansas+City&my_address[state]=MO&my_address[postal_code]=64116

Single-field address component syntax:

Since the Single-Field address string will require commas, you may have to URL encode the address before passing it in as a value for the parameter.

https://your-flow-url.com?my_address[raw]=123%20Main%20St%2C%20Apt%2017%20Kansas%20City%2C%20MO%2C%2064116

Autocomplete using Google Places API

If you are restricting referrers and/or embedding your Formsort flow, make sure to add flow.formsort.com (which is where your flow will be hosted) to the list of allowed referrers in the Google API console, in addition to any custom domains on which you are hosting your flows.

Whitelisting flow.formsort.app may be necessary for use of the Places API in the Live Preview as well!

When enabled, the address answer will also contain a raw field which stores the raw string that was entered by the user.

{
  "my_address": {
    "raw": "213 Main St., Apt 17, Kansas City, MO 64116",
    "address_1": "213 Main St",
    "address_2": "Apt 17",
    "city": "Kansas City",
    "state": "MO",
    "postal_code": "64116"
  }
}

Validating form addresses with USPS

This feature is only available for addresses in the United States.

See for more information on passing answers in to a flow.

Addresses are sometimes tedious to type, so you can use the to auto-complete addresses, by providing your API key.

When Validate addresses (US only)? is enabled, will be used to verify that the address is a valid US mailing address, once you provide your API credentials for USPS.

Region
template
URL Parameters
Google Places API
USPS web tools
Single field address vs default address components