How to add data column in the first column of extracted data?

Hi,
I have extracted data table with data scraping. Before writing it to an excel, I add customer number data with “add data column” activity and write it to each row. But it always writes to the end of each data in rows in excel. I need to place that at A column.
Could you please help?
Thanks,
Aysegul

1 Like

Hi @aysyavuz

Hope this would help you for sure buddy

Here the set ordinal is used to add the datacolumn at desired position and here in the xaml attached will have set at Column B with 1
you can mention as 0 to get added at first column

Here you go with that sample xaml
add datacolumn.zip (2.6 KB)

For more info on this

Kindly revert for any queries
Cheers

1 Like

@aysyavuz,

Have you tried using InsertAt predefined class?

Use this : ExtractDataTable.Rows.InsertAt(New entire row , position you want) …

So the steps you need to do is :

  1. Make the new data as a data row
  2. use the above condition to add at a specific position

Hi @Palaniyappan,
It works perfectly :slight_smile:

Thanks a lot,
Aysegul

1 Like

Fantastic
Cheers @aysyavuz
Kindly close this topic buddy with right comment marked as solution tht could help others

I’ve marked it as solution. Thank u @Palaniyappan

1 Like

Hi @aysyavuz
You can use UiPath.Excel.Activities.ExcelInsertColumn or UiPath.Excel.Activities.ExcelInsertDeleteColumns

image

You can find more information about this here:
Excel-Table-insert-column
Example
Excel-insert-delete-columns

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.