Skip to main content

We have a couple of dynamic input fields in our Zapier app actions. While testing the usability I’ve run over the case that I always need to make a selection from the dropdown list. Often there is a sane default throught.

Therefore we were wondering if the `default` setting could not be set to one.

Looking into the schemam1] it says the default is a string, so it looks like if it is static.

Is there a way to make it dynamic other than providing a special value the Zapier app imlpementation knows and would handle it then?

Additional context: The field has the `dynamic` property and is `required: True`.

 

<1]: /FieldSchema: https://github.com/zapier/zapier-platform/blob/master/packages/schema/docs/build/schema.md#fieldschema

Hi @toktok ,

You should definitely be able to set the default of a dynamic field. Have you tried to do that and not been able to do it?


Howdy @shalgrim , yes the default can be set to a static value. But my question is about dynamic values of the default (e.g. a functionSchema or similar). Do you have an idea about that?


Hm, I don’t think I fully understand how a default could be dynamic. Do you have a more specific example of how a default could be dynamic?


The dynamic offers a list of valid values and one of those dynamic values should be used as default value (e.g. the topmost one).


Hm…

The help docs state that default is “A default value that is saved the first time a Zap is created.”

Have you tried setting the value of that key to the output of a function that makes an API call (or whatever it is you’re doing to generate the dynamic list) and returning the topmost item?


I’d need to verify if it works in this case. Saved first time it’s created, to see what that means and if possible after all to defer it to some function return incl. promise. I’ll check and then report back, but may take a bit of time until.