I am saving multiple dropdown values like 3;4;5 and if I am passing the same value into an expression rule and doing for each it isn't taking individual value instead consider as 345.
How to convert 3;4;5 into {3,4,5}
Discussion posts and replies are publicly visible
The dropdown returns a list of values. What data type is the rule input of the expression? It should be a list of integer.
I am passing this value into local variable and then from a!forEach(items :local!data,expression: rule!getData(employeeid: fv!item).local!data : ri!employeeData[Recordtype!OD_EMP_RECORDS.fields.employeeid].
I am not sure what you are doing here.
But in general, storing a list of integers into a single string turns {1, 2, 3} into "1;2;3". This is what you observe. To avoid this, make sure to keep your data types a list of integer consistently.
And no, working around that issue by using split(), works, but is a super ugly solution and will get you into trouble on the long run!
HI hemap0003Please find the code below. By passing the selected dropdown value into an expression rule and iterating through it using a foreach loop, it will become the 'items' for further processing.
a!localVariables( /*The below localVariable will hold selected drop down values*/ local!dropDownValues: tostring({ 3, 4, 5 }), if( a!isNullOrEmpty(local!dropDownValues), "", split(local!dropDownValues, "; ") /*By using split function the data will be displayed as a list*/ ) )
That is not solving the issue, but trying to work around it, after creating it in the first place.
I have again used split function on local variable and able to get the desired output.
Thanks
Thanks for your response