Multiple Dropdown Duplicate Values

a!sideBySideItem(
item: a!multipleDropdownField(
label: "Status",
labelPosition: "ABOVE",
choiceLabels: {
"Active",
"Approved",
"Cancelled"
},
choiceValues: {
true,
true,
true
},
saveInto: {local!activeSOWs, local!approvedSOWs, local!cancelledSOWs},
validations: {}
)
)

All three of the variables I would like to saveInto are booleans but I am getting an error:

Interface Definition: Expression evaluation error at function a!multipleDropdownField [line 700]: A multiple dropdown component [label="Status"] has an invalid value for "choiceValues". Duplicate items are not allowed in the choiceValues array, but choiceValues was true; true; true.

How can I set the three variables to true when the labels are selected? Thanks!

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer
    This isn't how the saveInto of a multiple dropdown field works. The output is supposed to be a single variable representing an array of the items chosen in the dropdown.

    If it weren't for the error you're getting, you would still not be getting the output you're expecting in your three local variables. What you would get instead is the same value being saved to all 3 local variables. As soon as you choose one of the dropdown values, all 3 local variables would have their values set as an array of one item relating to the one choice chosen. When a second one is chosen, all 3 would have their values set as an array of 2 items, etc.

    Can you tell us a little bit more about your use case, and what values you were expecting the three local variables to have after the dropdown field is interacted with? That way we can perhaps suggest a solution, which I'm guessing will involve some standard saveInto gymnastics.
Reply
  • 0
    Certified Lead Developer
    This isn't how the saveInto of a multiple dropdown field works. The output is supposed to be a single variable representing an array of the items chosen in the dropdown.

    If it weren't for the error you're getting, you would still not be getting the output you're expecting in your three local variables. What you would get instead is the same value being saved to all 3 local variables. As soon as you choose one of the dropdown values, all 3 local variables would have their values set as an array of one item relating to the one choice chosen. When a second one is chosen, all 3 would have their values set as an array of 2 items, etc.

    Can you tell us a little bit more about your use case, and what values you were expecting the three local variables to have after the dropdown field is interacted with? That way we can perhaps suggest a solution, which I'm guessing will involve some standard saveInto gymnastics.
Children
No Data