Skip to main content
jaideepb0002
July 16, 2022
Solved

Multiple dropdown - All selected values must be present in the choiceValues array, but value was 1 and choiceValues was 1; 2.

  • July 16, 2022
  • 3 replies
  • 0 views

Hi, 

I am getting the error --> A multiple dropdown component [label="Multiple Dropdown"] has an invalid value for "value". All selected values must be present in the choiceValues array, but value was 1; 2 and choiceValues was 1; 2.

a!multipleDropdownField(
  label: "Multiple Dropdown",
  labelPosition: "ABOVE",
  choiceLabels: {1,2},
  choiceValues: touniformstring(1,2),
  value: tostring(ri!nocareas),
  saveInto: ri!nocareas,
  searchDisplay: "AUTO",
  validations: {}
)

Applied the suggestion as given here (by Stefan) - https://community.appian.com/discussions/f/user-interface/25021/all-selected-values-must-be-present-in-the-choicevalues-array/96892#96892 but not working..

When I do the same with simple dropdown (of course - single selection) - I do not get any error.

ri!nocareas is of type: text

what am I doing wrong ?

your help will be appreciated..

thanks

jaideep

Best answer by rahata9316

Hi Jaideep,

Can you please try below expression & try to change ri!nocareas as "Array" of text

a!multipleDropdownField(
label: "Multiple Dropdown",
labelPosition: "ABOVE",
choiceLabels: {"1","2"},
choiceValues: {"1","2"},
value: ri!nocareas,
saveInto: ri!nocareas,
searchDisplay: "AUTO",
validations: {}
)

3 replies

rahata9316
July 16, 2022

Hi Jaideep,

Can you please try below expression & try to change ri!nocareas as "Array" of text

a!multipleDropdownField(
label: "Multiple Dropdown",
labelPosition: "ABOVE",
choiceLabels: {"1","2"},
choiceValues: {"1","2"},
value: ri!nocareas,
saveInto: ri!nocareas,
searchDisplay: "AUTO",
validations: {}
)

jaideepb0002
July 16, 2022

wow .. works like a charm. Thanks a ton. 

harshitb6843
July 17, 2022

Just making the datatype a list should work. The rest of the code is fine.