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 🙂
I am an engineer by profession and by heart :)
It's been 7+ years since I have been working with software development and robotic process automation.
I have implemented close to 80+ RPA processes in total by using Uipath.
It is so true that someone learns more by not reading something but by practicing the skill.
I have been trying to understand exactly where people who are just starting out their career struggle and understand the pain of struggling for hours trying to figure something out.I can help you with that.
Having a passion to share my piece of content, I have created step-by-step easy-to-digest courses.
My goal is to help you get ready for the future by learning new talents and becoming more productive by providing you with relevant and useful courses.
I'm still learning and exploring my field of work :)
Every feedback should be as valuable as you are to me, please feel free to reach out to me if you have any feedback, questions, or need any help.Thank You...
View all posts by Sharath Raju
6 thoughts on “How To Transpose DataTable – In UiPath”
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.
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.
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?