Getting above error how to resolve .. as value is null ..
Discussion posts and replies are publicly visible
a!localvariables(local!leadData: rule!PRO_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 ))
try using this code
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:if(a!isNullOrEmpty( local!credentiallingTypes),null(), local!credentiallingTypes),saveInto: local!credentiallingTypes))
Please try to use this feature next time to make the code more readable.
As the error message indicates, you can only a value in the "value" parameter that is also present in the choice values. This is the basic nature of all the Appian components having multiple options to choose from.
thanks
a!dropdownField( label: "Select " & cons!TTP_CONFIG_DISPLAY_VALUES[3], labelPosition: "ABOVE", placeholder: "Select a Data", choiceLabels: local!client['recordType!{a3480fb1-15c0-4549-8121-7b4bfe485728}TTP Client.fields.{022666ad-2a5e-48b1-a87a-a30eee29b231}firstName'], choiceValues: local!client['recordType!{a3480fb1-15c0-4549-8121-7b4bfe485728}TTP Client.fields.{7cefb235-e416-4c2f-b471-dc52652e4b18}clientId'], value: if( and( a!isNotNullOrEmpty( local!client['recordType!{a3480fb1-15c0-4549-8121-7b4bfe485728}TTP Client.fields.{7cefb235-e416-4c2f-b471-dc52652e4b18}clientId'] ), contains( local!client['recordType!{a3480fb1-15c0-4549-8121-7b4bfe485728}TTP Client.fields.{7cefb235-e416-4c2f-b471-dc52652e4b18}clientId'], ri!request.clientId ) ), ri!request.clientId, null() ), saveInto: { a!save(ri!request.clientid, save!value), a!save(ri!request.consumerid, null()) }, searchDisplay: "AUTO", required: true, validations: {} )
Check the above code
You can use index function instead of a!isnullOrEmpty
index(recordType!Department(name: "Engineering"), recordType!Department.fields.name, "")
link: docs.appian.com/.../fnc_array_index.html
As I already pointed out in your duplicate thread, the value must resolve to a non-array NULL when initially loading the dropdown as empty.