All Collections
Using Hive
Workflows with Forms & Automation
Using 'Choices from Web' to populate in Hive Forms
Using 'Choices from Web' to populate in Hive Forms
Did you know you can pull a dynamic list of data from a GET request?
Eric Typaldos avatar
Written by Eric Typaldos
Updated over a week ago

How it works

With the 'choices from web' option on the Hive Form questions, you can input a URL for a GET request to return a list of data to the person filling out your Hive Form.

Here are a couple examples:

  • Choosing a customer that you will be working from a list of approved customers

  • Selecting which country your project will be taking place in

How to set it up, using the country example:

  1. Go to Hive Forms

  2. Select a form question type with a select list

  3. Open the question widget and navigate to Choices from web

    1. This URL returns a list of countries and each country has information such as: official name, a shorthand name, and region

  4. Update the "Value name" field to be "officialName". This will make sure that we present the official name in the dropdown*

  5. Complete the rest of your form, save, and try it out!

*This field is required if you return a list of objects and need to pick which field to present in the dropdown. If the GET requests only returns a list of text this field is not required.

How to use answers from previous questions to filter your API using the country example:

  1. Go to Hive Forms

  2. Select a form question type with a select list and open the question widget

  3. Name the field "region" and set the choices as: "Africa", "Americas", "Asia", "Europe", "Oceania"

  4. Add a new select list field and open the widget

  5. Navigate to choices from web and set the URL to "https://surveyjs.io/api/CountriesExample?region={region}"*

    1. This URL returns a list of countries like in the example above, but only for a specific region

  6. Update the "Value name" field to be "officialName". This will make sure that we present the official name in the dropdown

  7. Complete the form and click save

  8. Now when you select a region, it will filter the country options in the 2nd dropdown!

*the region parameter in braces must match the name of a previous field to correctly set the value. Capitalization is important.

Tips & Resources

Did this answer your question?