How to transpose columns to rows in datatable?


I want the inverse process of the following :

How to transpose row to column in datatable?

Means :

From :

To :

Note : For my case I have many rows not only one
Thanks in Advance

Have you tried searching for same question in forum, i think there is a post on the same.

So i think the only solution to your problem is to iterate through you data table using for each row activity and create your new table from that.


I search but didn’t find exact solution for my case , all foudn case are rows to columns, here’s my example :

I find DataManipulation Package but I don’t know how to set the inputs

In this case use
Build data table activity, add 2 columns
Then inside for each row use in ur original data table
4 Add rows

add row(‘firstname’ ,row.item[0])
add row(‘lastname’ ,row.item[1])
add row(‘address’ ,row.item[2])
add row(‘mobile’ ,row.item[3])

Then write this datatable to excel uaing write range

1 Like

Thanks, I will check and let you know…

not clear can you please explain more, in my for each activity, it’s stating the rows but for my case need to state columns!!!

Hello @hsendel

In the activity set the input as below

You’ll also find the guide under resources…


Thanks Lahiru.Fernando
I use it but I got the following :
My Needed Output is :

here you go with a xaml
hope this would help you (17.4 KB)

Cheers @hsendel


Excellent!!! Palaniyappan.Thanks Lahiru.Fernando too for your support.


Another query, How to deal with Build Data Table of number of rows is not fix ( Changing) ?

Usually here we will having only two columns right
left is column name and right is value of the column, so two in total

Cheers @hsendel

1 Like

YES YES Correct !!! :slight_smile:

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