Skip to main content
All CollectionsUsing HiveWorkflows 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 10 months ago

How it works

With the 'Choices from RESTful Service (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. Navigate to the question settings on the left and scroll down to Choices from a RESTful Service

    1. This URL returns a list of countries and each country has information such as ID, name, and people.

  4. Update the "Get values from the following JSON field" field to be "id".

  5. Update the "Get display texts from the following JSON field" field to be "name". This will make sure that we present the name in the dropdown*

  6. 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. Set up the 1st form question using the country example above.

  3. Create a new form question: select a form question type with a select list and navigate to the question settings on the left.

  4. Navigate to choices from a RESTful service and set the URL to "https://65b911f7b71048505a8a1c44.mockapi.io/api/v1/countries/{Country}"

    1. This URL returns a list of "people" in the selected country based on previous form field selection.

  5. Update the "Path to data within the service" field to be "people".

  6. Update the "Get values from the following JSON field" field to be "name".

  7. Update the "Get display texts from the following JSON field" field to be "name". This will make sure that we present the name in the dropdown.

  8. Complete the form and click save.

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

Tips & Resources

Did this answer your question?