Hi,
When I am trying to assign an array to a local variable and use the same for dropdown choiceLabels and choiceValues, I am getting an error.
Any idea why I am getting this error.
Discussion posts and replies are publicly visible
Don't use merge function to append two arrays. Review Appian documentation if you are not sure about that function. I am posting a sample code here, it will work for your case.
a!localVariables( local!reviewOptionLable1AI: {"Additional Info Required"}, local!reviewOptionValueAI: {"AIR"}, local!reviewOptionLabelCancel: {"Cancelled"}, local!reviewOptionValueCancel: {"CSED"}, local!reviewOptionLable: {local!reviewOptionLable1AI, local!reviewOptionLabelCancel}, local!reviewOptionValue: {local!reviewOptionValueAI, local!reviewOptionValueCancel}, a!formLayout( contents: { a!dropdownField( label: "Review Options", placeholder: "--- Select a Review Option ---", choiceLabels: local!reviewOptionLable, choiceValues: local!reviewOptionValue, value: "",/*your rule input*/ saveInto: { /*save back to your rule input*/ } ) } ) )
Use the append or flatten function instead. Flatten is used to flat a nested array. Append, as the name suggests, is used to append a variable to an array. Using merge will create a nested array that will cause problems.
Thanks