You can set up a FEEL expression to iterate through a list, apply a condition to each item in that list, and return the resulting list.
Open the Interactive Shell
Open FlexRule Designer and be sure the DMN extension is installed. From the top ribbon menu, open the interactive shell to test out FEEL expressions– go to Tools>InteractiveShell

The format of a for in return statement is as follows:
for name for iterator in context return condition
Examples
Here are some examples of for-in-return in FEEL that you can try in the interactive shell:
for x in [2,4,6,8] return x-1
result: [1,3,5,7]
for i in ["cat", "dog", "bird"] return upper case(i)
result: ["CAT", "DOG”, "BIRD"]
for x in [date and time("2012-12-24T23:59:00"), date and time("2012-12-22T03:45:00")] return day of week(x)
result: [“Monday”, “Saturday”]
This FEEL expression can be used anywhere in DMN logic and can be useful when a loop strucure is not practical.
Summary of the for-in-return in FEEL
for in return statements are essentially a way to efficiently iterate through a loop and apply changes to each element. They can be applied to any logic in DMN models by using the FEEL expression. FlexRule provides an intuitive way to create models and use the for-in-return in FEEL. Take a look at this section of our resource hub guide on FEEL expressions to learn more about list operations.

