Formcrafts - a form and survey platform for Salesforce, HubSpot, etc
  1. Templates
    1. All templates illustration
      All templates
    2. Application forms illustration
      Application forms
    3. Calculation forms illustration
      Calculation forms
    4. Lead generation forms illustration
      Lead generation forms
    5. Customer service illustration
      Customer service
    6. Evaluation forms illustration
      Evaluation forms
    7. Survey and feedback illustration
      Survey and feedback
    8. Operations forms illustration
      Operations forms
    9. Payment forms illustration
      Payment forms
    10. Booking and registration illustration
      Booking and registration
    11. Salesforce forms illustration
      Salesforce forms
    12. Other forms illustration
      Other forms
  2. Features
    1. 18 Form Fields illustration
      18 Form Fields
    2. 19 Integrations illustration
      19 Integrations
    3. Conditional Logic illustration
      Conditional Logic
    4. Multi-step Forms illustration
      Multi-step Forms
    5. Calculations illustration
      Calculations
    6. Partial Submissions illustration
      Partial Submissions
    7. Save & Resume illustration
      Save & Resume
    8. Payments illustration
      Payments
    9. Hidden Fields illustration
      Hidden Fields
    10. Dynamic Dropdowns illustration
      Dynamic Dropdowns
    11. Engagement analysis illustration
      Engagement analysis
    12. Multilingual forms illustration
      Multilingual forms
  3. Pricing
  4. Help
  5. Login
  6. Signup
    →
  • Help index
  • Features
    • Conditional logic
    • Prefill forms
    • Multi-step forms
    • Calculations
    • Partial submissions
    • Field references
    • Save and resume
    • Hidden fields
    • Dynamic lookup
    • Workflows
    • Dynamic dropdowns
    • Multilingual forms
    • Privacy mode
    • Success message
    • Form redirect
    • GA/GTM
    • Accept payments
    • Linked forms
    • Disable form
  • Styling
    • Custom CSS
    • Custom fonts
    • Color scheme
    • Form background
  • Analytics
    • Test mode
    • Overview
    • Field analytics
    • Form engagement
  • Workflows
    • Send emails
    • Form redirect
    • Success message
    • Webhooks
    • Create PDF
    • ActiveCampaign
    • Asana
    • Mailchimp
    • Front app
    • Freshdesk
    • Google Sheets
    • Pipedrive
    • Linear
    • Klaviyo
  • Sharing
    • Custom form link
    • Embed on a page (inline)
    • Embed on a page (popup)
    • Embed in emails
    • Embed on WordPress
    • Embed on Shopify
    • Embed on Squarespace
  • Salesforce
    • Overview
    • Create records
    • Update records
    • Related records
    • Dynamic picklists
    • Attach files
    • Create PDFs
    • Form prefill
  • HubSpot
    • Overview
    • Create contact form
    • Create lead capture form
    • Create customer survey
    • Prefill HubSpot form
    • Embed on HubSpot page
    • Uninstall
  • Zendesk
    • Create ticket form
    • Create CSAT survey
    • Embed on Help Center
    • Prefill ticket form
  • Admin
    • Users
    • Custom domain
    • Vanity subdomain
    • Subscription
  • Developers
    • Embed Library
    • API keys
    • API v1
    • API v2
  • Others
    • Partner program
    • GDPR compliance
    • Workflow logs
    • White labeling
    • Form speed
    • Zapier
    • Migration
  • Contact
  1. Help
  2. ›
    Features
  3. ›
    Dynamic dropdowns

Dynamic dropdowns

On this page
  1. Introduction
  2. Remote URL
  3. Google Sheets
  4. Salesforce

Introduction

Options for a dropdown field are generally static and are defined in the form builder. However, there are cases where you might want to fetch the options for a dropdown from a remote source dynamically.

When editing the dropdown field go to the Options tab. Here click on Source to see the list of possible sources for the options (the default being List):

Source list for dynamic dropdown options
Sources for dynamic dropdown options

Dynamic dropdowns are a powerful feature, not offered by most form builders like Typeform ↗.

Remote URL

This allows you to fetch the options from a public URL. The URL must return the options in this format:

{
  "total": 100,
  "data": [
    { "value": "1", "label": "Option 1" },
    { "value": "2", "label": "Option 2" },
    { "value": "3", "label": "Option 3" }
  ]
}

If the data is not in the above format you can use the Custom JSON path option to specify the path to the options and other fields.

You can use our demo endpoint https://api.formcrafts.com/public/options to test this feature.

Remote URL source for dynamic dropdown options
Using the remote URL source

Click on the Preview button on the top-right corner to see the options fetched from the remote URL.

There are some configuration options when using the remote URL source:

Enable pagination: When enabled, the dropdown will request the options in chunks. Example, when the user first opens the dropdown it will request the first 25 options. When the user scrolls down it will request the next 25 options and so on. We will append limit and page as query parameters to the remote URL.

Remote search: When enabled, the dropdown will send the search query to the remote URL, allowing the remote server to filter the options based on the search query. We will append an s query parameter to the URL to achieve this.

Together, these two options allow you to connect your dropdown to a source with any number of options.

Authorization header: You can also add an authorization header to the request. This is useful when the remote URL requires authentication. If you are using sensitive tokens here please create a separate token with limited access.

Custom JSON path: Sometimes, the data from the remote URL might not be in the exact format we need. JSON paths help us find and use the right information from the data we receive. Here’s how it works:

  • Option list path: This tells us where to find the list of options in the data.
  • Total count path: This shows us where to find the total number of options.
  • Option label path: This points to where each option’s display text is located.
  • Option value path: This indicates where each option’s behind-the-scenes value is found.

Option list path, and option value path are required.

For example, if your data looks like this:

{
  "result": {
    "count": 100,
    "items": [
      { "name": "Apple", "details": { "id": 1, "color": "red" } },
      { "name": "Banana", "details": { "id": 2, "color": "yellow" } },
    ],
  },
};

Your JSON paths might look like this:

  1. Option list path: $.result.items[*]
  2. Total count path: $.result.count
  3. Option value path: $.details.id
  4. Option label path: $.name

This tells the dropdown where to find each piece of information it needs. By using these settings, you can make the dropdown work with many different types of data from remote URLs.

JSON paths are written in JSONPath ↗ syntax. You can test your JSON paths using this tool ↗.

You can also reference other fields in the remote URL. This allows you to fetch options based on the value of another field. For example, if you have a dropdown for countries and a dropdown for states, you can fetch the states based on the selected country:

Remote URL source for dynamic dropdown options, with field references
Using the remote URL source, with field references

Google Sheets

You can fetch dropdown options from a Google Sheet.

For example, we have a Google Sheet with the following data:

Google Spreadsheet with contact records
Google Spreadsheet with contact records

We want the option labels to be fetched from the Name column (range A2:A11), and the option description from the Email column (range B2:B11).

We will configure the Google Sheets source as follows:

Dynamic dropdown options via Google Sheet
Using the Google Sheet source

Click on the Preview button on the top-right corner to see the options fetched from the Google Sheet.

Salesforce

Please read the Salesforce documentation for more information on how to fetch options from Salesforce.

Minimal, fast, and powerful. Try now.
Formcrafts - a form and survey platform for Salesforce, HubSpot, etc

Subtle Web Inc,
225 Railway St E,
T4C 2C3, Cochrane AB

Salesforce AppExchange partner logo HubSpot app partner logo
Templates
Application formsLead generation formsSurvey & feedback formsEvaluation formsSupport request formsBooking & registrationContact forms
Comparisons
vs AllFormAssemblyTypeformJotformWufooSurveyMonkey
Features
Conditional logicSalesforce formsHubSpot formsZendesk ticket formsEmail formsIntegrationsForm fields
Resources
Help centerBlogDeveloper APIGDPRStatusReport abuseContact us
Company
About usNonprofitCase studiesSecurityTerms and privacy