How to reverse a DataTable?

How do I Reverse a datatable?
Meaning, rows starting from say from 1 to n should become from n to 1!
How can this be achieved?

Thanks and regards,
Shreyas

1 Like

Hi @shreyasshete,
Maybe this thread helps:


Thanks and regards.
Despi

I had tried it but unfortunately it did not work out for me as it was throwing error in for each activity!

1 Like

Oh. Okay. Can you upload your workflow?

1 Like

@shreyasshete Try Like below it will work.

dt1 = dt.AsEnumerable.Reverse.CopyToDataTable

where dt and dt1 are datatable variables.

6 Likes

This one posted by @Manjuts90 works!
:slight_smile:

9 Likes

Sort DataTable also helps if any column can be arranged in descending order

2 Likes

You’re right :slight_smile:

1 Like

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