How to implement while or do while logic in expression rule?
Discussion posts and replies are publicly visible
As others have said you cannot break out of a loop in Appian, you have to let it run to the end of the provided list. Typically what I do is output 'null' when my condition is not met, and the value I do want when the condition is met, and then remove the nulls from the generated list.
Thank you, I will look into that.
Here's trivial example to illustrate the idea:
fn!reject( a!isNullOrEmpty, a!localVariables( local!myList: fn!enumerate(10) + 1, a!forEach( items: local!myList, expression: if(fv!item = 5, fv!item, null) ) ) )