Skip to main content

I’m trying to set a default value to a dynamic field where dict is true. This would be the example FieldSchema: 

key: “attributes”,

dict: true,

default: {“Points”: “42”}

However, the default value type is string so the default gets set incorrectly where the keys become string indices and the values are the values at a given stringified JSON index. 

Is it possible to set a default key-values to a dict field?

Hey @kevin-underdog-protocol 👋

dynamic and dict are mutually exclusive - so you wouldn’t be able to use both those properties: https://github.com/zapier/zapier-platform/blob/main/packages/schema/docs/build/schema.md#fieldschema 

Regardless, since the default property expects a string, I wouldn’t expect you to be able to set a default key-value pair by inserting the object like that 🤔

I’m not sure if it helps, but I found this similar question where the suggestion was to set default to the output of a function that makes an API call and returns the topmost item for example. If you give that a try and have success, let the Community know!