How to write data column collection to excel

hello community,

I have data column collection and i need to write data column to excel

this is the data column collection which i’m getting through for each loop , I need to add this entire column(DataType- DatacolumnCollection) in excel , and next current item will also be in the same format , i need to repeat this and write all columns in the same sheet

image

the Final output looks like this

image

regards,

Hi,

I think first you have to convert the collection into a data table.

To convert a collection to a data table in UiPath, you can use the Build data table activity to create a data table. Then, you can drag an ‘Add Data Row activity’ and pass your List (Of String) adding.ToArray. Afterward, specify your data table as property tool.

Alternatively, you can use the ADD DATAROW activity where in the data table property mention the data table name and in the Arrayrow property mention the collection. If the collection is a list, then mention it like this: yourlistvariable.ToArray()

After the conversation you can simply write the values from the data table into the Excel file in a same sheet.