I have multiples expression rules that gather data as lists, and I am trying to organize them as 1 list to display in a form.
Long story short I need to show a list of interfaces, and when building the list with nested for loops, I need to add a list to the main list, and it only adds the first item of the list. I have tested the for loop structure, and the fv!itemCount of the inner for loop is 4, and only adds the first value to the main list. Is there a way to add a list to a list as the individual items?
Basic code structure looks like
forEach(
items: list from variable,
expression: forEach(
expression: if(
condition,
items: list from expression based on parent for loop value,
expression: interface *Here is where it only adds the first value*
),
interface
)
What do I need to do so this results in a flat list of interfaces? in the if statement I either need to add one interface, or add multiple based on the condition. It currently only adds one interface even when the for loop is given a list of 4 items
Discussion posts and replies are publicly visible
Appian will try to flatten if you just append or type cast. Have you considered using dictionary to help preserve the nested list structuring?
load( local!a: enumerate(9), local!b: enumerate(11) + 1000, { a!forEach( items: local!a, expression: { first: fv!item, second: local!b } ) } )