Skip to main content
sunus0001
Inspiring
Mar 23, 2022 11:20 AM UTC
Solved

Dropdown error ,getting invalid value for value ,All selected values must be present in choiceValues array

Hi Appian Team,

We are getting the following error,

Interface Definition: Expression evaluation error in rule 'pf_sections' at function a!dropdownField_20r2 [line 84]: A dropdown component [label=“Shipper”] has an invalid value for “value”. All selected values must be present in the choiceValues array, but value was 4473 and choiceValues was .

We have integer or number tyepe in choicevalue as well as in the value field , both types are same can anyone help me out to clear this error?

Thanks

Sunu Sam

viraty527193
Inspiring
Mar 23, 2022 1:06 PM UTC

Hi [mention:c051f1f8459746e8b0c8b42a4fc45a7c:e9ed411860ed4f2ba0265705b8793d05]

I have also faced the same issue couple of times, sometimes it is resolved by using the property function in the value parameter of the dropdown like below:

property(ri!PF_Request,"ShipperID",{})

using property will help you to define a default value in case the field is empty.

This has worked for me, you can try this.

11 replies

stewart.burchell
Employee
Mar 23, 2022 11:23 AM UTC

Might be because you haven't configured the dropdown to have a placeholder:

placeholder (Text): Text to display when nothing is selected and the value is null.

...if not,then you need to share the code so the community can diagnose with a bit more insight.

sunus0001
sunus0001Author
Inspiring
Mar 23, 2022 11:28 AM UTC

Hi Stewart,

Please check the below dropdown code

a!dropdownField(
label: "Shipper",
labelPosition: "ABOVE",
helpToolTip: "Note: This is not the carrier",
placeholderLabel: "--- Select a Value ---",
choiceLabels: index(local!ShipperMapping, "Shipper", {}),
choiceValues: index(local!ShipperMapping, "ShipperID", {}),
value:ri!PF_Request.ShipperID,
saveInto: {
ri!PF_Request.ShipperID,
a!save(ri!PF_Request.OtherShipper, null)
},
required: and(
rule!GLB_isBlank(ri!PF_Request.ShipperID),
and(
or(
or(
ri!PF_Request.PO_SO_STO_INDEL_OUTDEL = "PO",
ri!PF_Request.PO_SO_STO_INDEL_OUTDEL = "SO",
ri!PF_Request.PO_SO_STO_INDEL_OUTDEL = "STO",
ri!PF_Request.PO_SO_STO_INDEL_OUTDEL = "OD",
ri!PF_Request.PO_SO_STO_INDEL_OUTDEL = "ID"
),
ri!PF_Request.PO_SO_STO_INDEL_OUTDEL = "B"
),
or(
ri!PF_Request.ShipmentDirectionID = "1",
ri!PF_Request.ShipmentDirectionID = "3"
)
)
),
validations: {}
),

stewart.burchell
Employee
Mar 23, 2022 11:33 AM UTC

placeholderLabel isn't the correct attribute name. It should be 'placeholder'

peter.lewis
Employee
Mar 23, 2022 1:22 PM UTC

Can you show what the result of the variable local!ShipperMapping is? I'm guessing that the variable doesn't have a field called "ShipperID" and that's why it isn't returning anything for the choiceValues.

sunus0001
sunus0001Author
Inspiring
Mar 23, 2022 2:51 PM UTC

Hi Peter ,

you are right , the rule that fetch local!ShipperMapping did not use ".Data", so it was not fetching the shipperID properly.

thanks

Sunu Sam