How to Sort DataTable Columns?



I have this kind of columns, is there any way to sort the columns, and make the rows following too (not sorting the rows by its columns)?

Current Data:

Expected Result:

Thank you in advance!


ColumnSort.xaml (10.2 KB)


I was looking at this at same time as @vvaidya, cause this got me interested.

Here is my solution. It’s basically the same, just slightly different logic.
SortColumns.xaml (11.9 KB)

I wonder if this is possible without a ForEach though like through only. Probably not since it changes the datatable.


Hey @whyyouandi

please find the attached sample workflow: Sort_DataTable (8.1 KB)

This one is without set-ordinal and loop :slight_smile:



Thank you @vvaidya, @ClaytonM and @aksh1yadav for the fast5 reply and kindly making the sample too.

Decided the Solution based on personal preference (I don’t understand VB so a slightly difficult but not having many activities saved me a lot when remembering), but tried all of them and all working nice as a solution for the question. Again thank you!