I have used an multiple dropdown box here and whenever i try to select more than 1 option from the multiple dropdown list it is showing this error. Can anyone please guide me through this issue kindly.Thanks and Regards.
Discussion posts and replies are publicly visible
a!localVariables( local!save, a!multipleDropdownField( choiceLabels: { 1, 2, 3, 4 }, choiceValues: { 1, 2, 3, 4 }, labelPosition: "ABOVE", placeholder: "--- Select Experience ---", value: local!save, saveInto: { local!save, a!save(ri!save, joinarray(local!save, ";")) }, searchDisplay: "AUTO", required: true, validations: {} ) )
This was the error i got while running the code and chose more than a single value.
I hope you need to keep a ruleInput as named "save". Can you please check once?
You need to create rule input name called “save” as string and array.
It is working fine but my doubt here is wether i should create an rule input everytime i have to use a multipledropdown box ?
a!localVariables( local!save, { a!multipleDropdownField( choiceLabels: {1, 2, 3, 4}, choiceValues: {1, 2, 3, 4}, label: "Multiple Dropdown", labelPosition: "ABOVE", placeholder: "Please select your value", value: local!save, saveInto: { local!save, a!save( ri!details['recordType!{f55afdcb-53bf-4764-9d6b-79d1e1490735}PSB Details.fields.{13e93854-b8f9-4fd4-9f17-af26b1efaa1f}contactNumber'], joinarray(local!save,";") ) }, searchDisplay: "AUTO" ) } )
1.
2.
If we configure a rule input with a record type, we cannot assign an array value directly (we get error as per the image 1). However, we can assign a joinArray in a!save() and map the value to the ruleInput.
chaliki said:However, we can assign a joinArray in a!save() and map the value to the ruleInput.
As I mentioned yesterday, I would strongly recommend avoiding using JoinArray or other ad-hoc methods of concatenating the array, since parsing the joined string back into its original members often becomes tricky when corner cases are introduced (especially when there's any confusion about delimiters, extra whitespace, etc). A JSON string is definitely the way to go when needing to store multiple values in a single string in a future-proof manner, despite that it's not exactly a Best Practice to even do this in the first place.