How to combine from for each row and datatable from data scraping?

excel

#1

Hi,

I got a a bit of problem here with uipath of how to combine data and run for each row.

pic2

For example i got 1 datatable about. with name “DT01”.
when I run uipath for each row of the datatable, with each name, uipath running and scaping the datatable 02 from the webstie.

This datatable, I can put a name on it “DT02”
The question is how can I make a third data table DT03.
with name of each person before each row of the scaping datatable?
Thank you a lot for your help.
Hung


#2

Hi @hungdo,
After the datascrap, Add new Column “Name” with default value “DT02”.

image

Regards
Balamurugan


#3

Hi Balamurugan,


I tried follow your instruction, your way give out error.

and I also tried.

It lets me go through, and I use append range to add datatable to a excel file.
But the name column still missing.
even i tried on both datatable and defaultvalue, i put in there Extractdatatable. it give me error as well.

Any advice.

Thank you for your help.
Hung


#4

Hi @hungdo,
Can you share the source ?

Regards
Balamurugan


#5

@hungdo are you comparing any value from scrapping datatable to the excel datatable? What is the connection to Add the Name column value?

A linq join query will help to achieve this without using for each loop. But a relationship should exist between both tables.


#6

Hi Madhavi,
I only need the name in each line of scrapping data so later I can filter in excel.
for each name I got different out come.
Thanks
Hung


#7

@hungdo

Please try following steps-

  1. Retrieve data from Excel
  2. Create a new DataColumn Object. (new System.Data.DataColumn(“NewColumn”))
  3. Set default value for the datacolumn to the value that you need to update. (newColumn.DefaultValue = “YourValue”)
  4. Add the column in the datatable. Use invoke method