Appian Community and Appian Academy are being upgraded. As a part of the upgrade, Appian Community is currently in read-only mode, and user registration is disabled until August 3. We apologize for any inconvenience this may cause, but a more secure, stable, and performant Community experience is coming soon!
The new Appian Community launches August 3, followed by Appian Academy on August 7. During the migration, Appian Community Edition, Appian Academy, Documentation, Certifications, Instructor-led Customer Training, Partner Sales Training & Accreditation, and Forum (for Appian Partners and Customers only) will remain available.
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) ) ) )