Best answer

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

  • 1 June 2023
  • 1 reply
  • 87 views

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.

icon

Best answer by connorz 12 June 2023, 19:09

View original

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

Userlevel 3
Badge +6

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!