{1,2,3}, {56,76,54,32}, {12,23,45,54,32,54}, {1,2,3,4,5,6,7}, {8,9,10,11,12,13,14,15}
Please suggest how do this using foreach function get output like this,
Discussion posts and replies are publicly visible
Hi Amit,
Just to clarify, your input is a list of arrays, and you want to output the length of each item (array) in that list, right?
yes
Did you try to use count() inside a foreach()? This seems pretty trivial to do. What did you try, what was the outcome?
Appian doesn't really support list of list. It will flatten them down. If you are building this list via some logic, then I would recommend you to count it then and there.
Thank you, Stefan for your reply
As Harshit mentioned, the way you defined this list, Appian will join it into a single list.
Now, is there a specific reason you discuss this?
Use a list of dictionary instead, where each dictionary has an array as one of its properties.
As the others mention, if these are properly defined in a dictionary or map, use:
a!localVariables( local!data: { a!map(list: {1,2,3}), a!map(list: {56,76,54,32}), a!map(list: {12,23,45,54,32,54}), a!map(list: {1,2,3,4,5,6,7}), a!map(list: {8,9,10,11,12,13,14,15}) }, a!richTextDisplayField( value: a!richTextBulletedList( items: a!forEach( items: local!data, expression: a!richTextListItem( text: concat( "length of array ", fv!index, " is ", count(fv!item.list) ) ) ) ) ) )
its give nested result