How to store items in DT in proper order?

Hi,
image
I’m creating a data table before for each loop,

image

And in the for each loop im extracting pack id and adding it into the datatable.

So, if there are 3 pack ids in the loop, the bot is storing the packids in such a way 3, 2, 1.
so when i use the DT in further activities, if i loop through each item in DT the bot show 3rd item first , then second, then first. so basically it is storing in reverse order. how to make it store in such a way 1, 2, 3?

as your are using for each loop
and in that your are using just two activities right one is get text activity and other is Add Data row
can you check it once again if same issuse can you share the screenshot

Hi,

If you want to reverse order of the datatable, the following will work.

dt = dt.AsEnumerable.Reverse.CopyToDataTable()

Regards,

You can turn the dt upside down using reverse.
dt.AsEnumerable.Reverse.copytoDatatable

Hi ,
the output is :
Packid
{
2123
2124
}

The bot will be taking first item as 2124

When i reverse the order, it will be
{
2124
2123
}

But the bot is still taking first item as 2124, i want the bot to take 2123 as a first item

HI,

Can you share your workflow? (file is better if possible)

Regards,