How to invert a for each activity?

Hi all,
I need to use a for each activity in a list of integer, but i need to reverse the order (Start by the last item of the list and finish by the first item of it).

image

thank you so much.

HI @Julian,

The below post has similar a similar question as yours… This would be helpful in getting yours to work!!

Let know if it doesn’t work for you!!

Thanks
Lahiru

3 Likes

In the post he talk about reverse an array and a DataTable, but i have a List, when i tried to apply the method Reverse in my list this issue appear.

image

“the expression does not generate a value”

Solved!! i use the method AsEnumerable.Reverse
@Lahiru.Fernando Thank you bro!!

1 Like

Cool… You are welcome!! :slight_smile: Would be great to help anytime…

Thanks & have a good day!!

@Julian

Use invoke method and pass your list as TargetObject and set Method Name as Reverse.
Capture

But if your intention is to remove the last item from the list, then you can use,
Invoke method in side a do while loop by setting Method Name as RemoveAt, Target object as your list and in the Parameter property, set the last item index (number of items in the list - 1). The type of this should be Int.

Hope this is helpful!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.