Skip to main content
Best answer

How to set multiple default values in 'dynamic dropdown' control ?

  • June 1, 2023
  • 1 reply
  • 100 views

Neha Lodha
const defaultValues = ['123','456'];

const field = {                       
                 key: 'testUniqueId',
                 label: 'Contacts,
                 placeholder: "Set value",
                 type: "string",
                 default: defaultValues,
                 choices: [ 
		                   {
			                 "label": "contact one"
                             "value": "123",

                           },
                           {
			                 "label": "contact two"
                             "value": "456",

                           },
		                   {
			                 "label": "contact three"
                             "value": "789",

                            }
		                  ],
                required: true,
                list: true, 
                altersDynamicFields: true
             }                    



I am trying to add multiple values as default in multi-dropdownlist (list is true). But it is binding the default value as complete string.

Best answer by connorzBest answer by connorz

Hi @Neha Lodha ,

I’m afraid it’s not currently possible to set multiple default values in a multi-dropdown list field. 

For a bit of context, this is because the field schema expects the value of the default property to be a string. As a result, an array will be coerced into its literal string representation.

I’m sorry I don’t have better news!

View original
Did this topic help you find an answer to your question?
This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

1 reply

Forum|alt.badge.img+7
  • Zapier Staff
  • 91 replies
  • Answer
  • June 12, 2023

Hi @Neha Lodha ,

I’m afraid it’s not currently possible to set multiple default values in a multi-dropdown list field. 

For a bit of context, this is because the field schema expects the value of the default property to be a string. As a result, an array will be coerced into its literal string representation.

I’m sorry I don’t have better news!