Skip to main content
February 22, 2023
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 ...

  • February 22, 2023
  • 2 replies
  • 1 view

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
February 22, 2023

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
))

mikes0011
Brainy
February 22, 2023

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