I am building an app in Zapier GUI, I need to fetch the fields based on dropdown selection that user will make.
I had a parent dropdown, After the user action on parent I want to show child dropdown with values according to the parent dropdown that user has selected.
Can Any one help me how to solve this.
Consider this example. We have a dropdown with vehicle type... based on the user's selection, a dynamic field will be re-rendered with a collection of makers of that vehicle type from our api.
Here’s what the user should see in the Zap editor:
Dynamic Form Screencast
To accomplish this, as noted above, make sure 'alters dynamic fields' is set to true on the dropdown with the dependency value, in our case here the “Vehicle Type” dropdown. Every time a user makes a selection here it will send a message to all dynamic fields to re-run.
The code that’s managing the “Maker” dropdown in my screencast example looks like this:
There we can see I’m passing bundle.inputData.type as a parameter to my API. This was the user’s selection from the dropdown. I make a call to my API and from the results I dynamically build another dropdown with the results. This can return a single, or multiple fields.
Super handy reference for doing this. This is the schema definition for the field objects your code will need to create. https://zapier.github.io/zapier-platform-schema/build/schema.html#fieldschema
To test this, make a Zap with your action, and open up the Monitoring panel in the UI to see your console log statements and debug the API requests being made.
@Sarah Eb - Did you still need help? Looks like @PaulKortman was the last person on this conversation so I’ve mentioned him to see if I may be of more assistance.
@Sarah Eb I think I know what you’re trying to do, so you have field 1 and field 2, depending on the selection in field1 field 2 will have different options within it. correct?
It’s not so much about having fields appear and disappear, as much as it is about having field 2 be a dynamic field type and field 1 having the box checked for “Alters Dynamic Fields”
And then for Field2 you need to create the field as a dynamic field.
Then, use the contents of Field1 to lookup the options for field2, each time the user makes a change or a selection in field 1 the settings in field2 will be re-run to grab a list of options based on what is selected in field1.
Let me know if I need to explain more.
Hi Paul, I had checked the alter dynamic field option for field1. I am facing issues to return the list for field2 after fetching from API, And I also want to show field2 after user selecting some value in field1.
A sample code explaining this configuration for field1 and field2 will be helpful for me.
What is the API call you need to make to get the options for the field2?
Can Anyone help me with this ?
This is the endpoint for field2