How To Transpose DataTable – In UiPath


Few times while working with DataTables, we might want to convert rows to column and vice versa.

let’s see how to do that…!!!


Implementation using UiPath :

Let us implement a workflow to convert rows to columns in DataTable.

(If you find the logic a little difficult to understand, no worries please leave a comment and we will get back to you soon)

Sample File:
UiPath DataTable Transpose 0.PNG

Step 1:
Drag “Excel application scope” and “Read Range” activities into the designer panel to read the input excel

UiPath DataTable Transpose 1.PNG

Step 2:
Drag “While“, “Add Data Column” and “Assign” activities into the designer panel to create dummy columns
(Because here we are transposing the headers too)

UiPath DataTable Transpose 2.PNG

Step 3:
Drag “For Each Row“, “While“, “Add Data Row” and “Assign” activities into the designer panel and write the logic to convert rows to columns.

UiPath DataTable Transpose 3.PNG

Step 4:
Finally, execute the workflow to see the results 🙂

UiPath DataTable Transpose 4

Click here to download the Source Code…

Hope it has helped you… 


Sharath Raju

Author: Sharath Raju


2 thoughts

Leave a Reply