Converting List<dataRow> to datatable

Hi UiPath,

Is there a easy way to convert List<DataRow> into a datatable variable?

Thanks!

Hi @alvin.c.apostol26,

You could iterate through your List and add the row to a DT using Add Data Row:
image

Hi @alvin.c.apostol26

In the ArrayRow property of ‘Add Data Row’ activity, just supply the single string as an array,designated by curly braces {}

So it should be {item} in the ArrayRow property.

Have a look on the thread

Regards
Gokul

Hi,

FYI, the following will also work if the each items are from single datatable.

newDt = listDr.Select(Function(dr) dr.Table.Clone.LoadDataRow(dr.ItemArray,False)).CopyToDataTable

Regards,