Adding multiple rows in datatable using assign activity

Hello though there is a separate add datarow activity and i can always do for each to be able to transpose a datacolumn to row. I was wondering if someone can help and share with me code of doing the same using 1 assign activity. I think i can iterate the existing dt using .AsEnumerable(). My problem is how can i define multiple dt rows into a new datatable which will columns from old dt converted into new rows of the new datable. Appreciate if you can help me here

Although it’s recommended to use the Add Data Row and other datatable-specific activities, what you’re looking for is the Invoke Code activity.
In invoke code, you can simply patch all the code statements you need in your logic.

Please refer to below post. Hope it helps.

1 Like

Hello, i tried said activity, however, the activity transpose everything. Im not sure it has option to choose specific columns to be transposed

Will definitely look into the invoke code. If you dont mind if you can share sample code we can use and start on which transposes specific columns into rows?

Hey, once the data table is transposed save it into a new data table loop through its columns, and delete the columns that you don’t need.