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:
Go to Hive Forms
Select a form question type with a select list
Open the question widget and navigate to Choices from web
Add "https://surveyjs.io/api/CountriesExample" as the URL
This URL returns a list of countries and each country has information such as: official name, a shorthand name, and region
Update the "Value name" field to be "officialName". This will make sure that we present the official name in the dropdown*
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:
Go to Hive Forms
Select a form question type with a select list and open the question widget
Name the field "region" and set the choices as: "Africa", "Americas", "Asia", "Europe", "Oceania"
Add a new select list field and open the widget
Navigate to choices from web and set the URL to "https://surveyjs.io/api/CountriesExample?region={region}"*
This URL returns a list of countries like in the example above, but only for a specific region
Update the "Value name" field to be "officialName". This will make sure that we present the official name in the dropdown
Complete the form and click save
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