Providing choices via API or calculation
Dynamically loading select choices
Standard select questions have a discrete set of choices to select from that are defined at the time that the form is created. If the list of choices to present to your responders isn't known at the time the form is being built, or changes often, it's possible to load choices dynamically, from an API lookup or calculation.
Trying to look up an answer from an API? See API answers.
See this video comparing different approaches to specifying choices for a visual walkthrough.
Choice schema
Dynamically-loaded choices, whether from an API or calculated locally, must adhere to the following format:
Configuring an API lookup or calculation
With a select question selected, go to the CHOICES tab, and select Load choices dynamically.
External API
With External API selected, you will be able to configure an API lookup from which values will be retrieved.
If the API you are connecting to does not return results of the form described in the schema above, you can use a result mapping function to transform the result.
See API answers for more on how to specify API lookups.
Calculated locally
When calculated locally is enabled, you will be able to use Typescript to output the answers for responder.
For example, the following definition would create ten days of future dates as choices.
See calculated answers for more information on writing calculated answers inline.
Last updated