How to write a datatable column into a row in excel

hi everyone i am trying to write data from data table there is only one column in data table and i want to write that into excel in row format data should be put into excel like
price1 price2 price3
81.35 52.15 54.85 …and so on !!
currently all the data gets written into one single column in excel as it is in data table


Please find the attached xaml file.

Transpose.xaml (17.6 KB)

Hope it helps… :slight_smile:



Thanx @Madhuraj it was helpfull.
but what if i have the same data table in string format ex the numbers in the datatable have 81.35% 52.15% ,it is giving error when reaching invoke function giving Format exception! where should i change in the workflow to remove that percentage sign and do the same thing as done above(Transpose)??

I have used Int32 Data Type for List. You can use any type as per your requirement.

Hi @Madhuraj i used string while building data table and also inside add data coloumn activity but it gives error in invoke activity below is the edited version of the file you gave.

Transpose.xaml (20.8 KB)

hi @Madhuraj thanx for your suggestion i edited the work flow so that it could work with string it works now for string also.
Transpose.xaml (17.2 KB)

Hi I liked your solution and it works perfectly.However this example is for one column only.What if i have multiple columns to be converted into rows?I can no longer hardcode row(0).toString.

Have you got solution for this? I am new to UIPath…Need solution for this query…Kindly share the solution if you got one.


How could you adapt the code to only transpose the first two items of the column, instead of the complete column?