Few times while working with DataTables, we might want to convert rows to column and vice versa.
let’s see how to do that…!!!
Example
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:
Step 1:
Drag “Excel application scope” and “Read Range” activities into the designer panel to read the input excel
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)
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.
Step 4:
Finally, execute the workflow to see the results π
Click hereΒ to download the Source Code…
Hope it has helped you…
what is in while loop can elaborate please
Hi Rohit
Sure!!!
Pink me on LinkedIn
http://linkedin.com/in/sharath-raju
We can discuss over there π
Hi Sharath Raju,
Can you please explain the transpose project in detail, i.e. what is the neccessity of each activity inside the for each loop. it would be helpful for us to catch the stuff easily.
Best Regards,
Naveen Kumar S
Sure Naveen, will try to do it π
Hi Sharath!! I have your code in my project But I am getting error as RemoteException wrapping System.ArgumentException: Input array is longer than the number of columns in this table.
No worries Rohit, once check for the number of columns count and the array items count?