🪜How to Fetch Dropdown Options from an API
Note: This page only applies to the Old Rendering Engine - for the New Rendering engine ask a Savvy Expert for help
Step 1: Get the Dropdown Component Ready
Create the dropdown component
Check the "Fetch Options from an API" box that you'll find in the Advanced dropdown of the Options tab

"Allow typing" and "Clearable" should also be checked!

Step 2: Set your URI
Paste the URL you want to fetch from in the "Fetch URI" input box that's will appear when checking the "Fetch Options from an API" box
In the before-mentioned case where there are hundreds of results, you can do a live search by passing a query parameter. You'll have to add
{{$query}}
where the param should go. That will automatically insert whatever you type in the dropdown component in the fetch URI

Step 3: Add your Fetch Headers and Transformers
For the Headers, you'll need an object like this one:

And your Transformers need to be inside a function called "transformer" that gets passed
data
(the response from the fetch) as an argument and returns the data transformed.

Last updated
Was this helpful?