-
aldahirmolinaFecha de consulta 22 de noviembre de 2024, 9:53
Quiero prellenar un dropdown con data de una api es posible?
-
Royce Jotform SupportFecha de respuesta 22 de noviembre de 2024, 12:27
Hi Aldahir,
Thanks for reaching out to Jotform Support. Unfortunately, our Spanish Support agents are busy helping other Jotform users at the moment. I'll try to help you in English using Google Translate, but you can reply in whichever language you feel comfortable using. Or, if you'd rather have support in Spanish, let us know and we can have them do that. But, keep in mind that you'd have to wait until they're available again.
As for your question, I’ll need a bit of time to look into this. I’ll get back to you as soon as I can.
Meanwhile, let us know if you have any other questions.
-
Royce Jotform SupportFecha de respuesta 22 de noviembre de 2024, 14:22
Hi Aldahir,
You can use the Dynamic Dropdowns widget on your form because you can easily modify the options on the Dynamic Dropdowns widget via API using an HTTP POST request. You can clone my demo form, or you can do it on your end. Let me show you how to do it:
1. In Form Builder, click on Add Element on the upper-left part of the screen.
2. Click on the Widgets tab next to the Payments tab.
3. Type Dynamic Dropdowns on Search field.
4. Drag and drop the Dynamic Dropdowns widget to your form.After that, you can create an API key on the API tab in your account settings and use the API key to be able to modify the options on the Dynamic Dropdowns widget on your form via API using an HTTP POST request. Let me show you how to do it:
1. In My Forms, click on your Profile Avatar on the upper-right part of the screen.
2. Click on Settings below Admin Console.3. Click on the API tab on the left part of the screen.
4. Scroll down, click on Create New Key on the lower-right part of API Keys field.
5. Type your preferred name on the API you've added on API Keys field.
6. Click on the Downward Arrow icon on the right part of the API you've added.
7. Click on Full Access on the Dropdown list.
8. Copy the API key of the API you've added.9. Follow the example API request below. Take note that you can only use an integer on {field-selector}.
https://api.jotform.com/form/{form ID}/question/{field-selector}?apikey={API-key}&question[list]=Group 01
Option 01
Option 02
Option 03
Group 02
Option 01
Option 02
Option 03
Group 03
Option 01
Option 02
Option 03
10. Go to your API Platform, in my case it's Postman API.
11. Input the example API request on URL field.
12. Send the API request.That's it. You can check out our guide on API Documentation for more information.
Give it a try and let us know if you have any other questions.