Skip to main content
Inspiring
Feb 22, 2023 11:17 AM UTC
Question

A dropdown component [label="Type"] has an invalid value for "value". All selected values must be present in the choiceValues array, but value was and choiceValues was 117; 118. how to handle null over here ...

a!localvariables(local!leadData: rule!TRO_qrtLead(leadId: 244).data,

local!credentiallingTypes: if(
a!isNullOrEmpty(
local!leadData['recordType!TRO Lead.fields.credentialingTypeLookupRefId]
),
{},
local!leadData['recordType!TRO Lead.fields.credentialingTypeLookupRefId]
),

a!dropdownField(
label: "Type",
choiceLabels: local!TRO Lookup.fields.label,
choiceValues: local!TRO Lookup.fields.lookupRefId,
placeholder: "---Select Credentialling Types---",
value: local!credentiallingTypes,
saveInto: local!credentiallingTypes
))

how to handle null over here ?

2 replies

adityag9712
Inspiring
Feb 22, 2023 12:51 PM UTC

a!dropdownField(
label: "Type",
choiceLabels: local!TRO Lookup.fields.label,
choiceValues: local!TRO Lookup.fields.lookupRefId,
placeholder: "---Select Credentialling Types---",
value:
if(a!isNullOrEmpty(local!credentiallingTypes)
{},local!credentiallingTypes),
saveInto: local!credentiallingTypes
))

- Aditya
mikes0011
Brainy
Feb 22, 2023 6:21 PM UTC

The value MUST be NULL for a dropdown to properly pick up and use the placeholder - it's finnicky about this, so even an empty set will give you an error (consider that the single dropdown deals with, and requires, non-array data as the save value / target).

The Expression Guru