Add search parameter as a column to the search result


I have one datatable dt1 which i have through Data scraping and I’m using rows of particular column in dt1 as search parameter and scraping result set into another datatable dt2 and writing that data into CSV.Is there anyway I can have search parameter into column and append that to dt2 and write into csv.

I can’t use join here as both tables doesn’t have unique identifier.

To be more specific:
Dt1 column Employer ID(Search parameter for dt2)

when search generate results with columns Employer name , Status , Location (dt2)

I need to create a datatable dt3 with Employer Id ,Employer Name ,Status , Location

I appreciate your inputs.

Thanks in advance!

1 Like

Hello @pmaddala,
Welcome to the Community!
Not sure if I understand you correctly but please check Append Range activity with which you can add data to the table without removing existing data. Hope this helps :wink:

1 Like

Thanks Pablito for your response.When i use append range it is just adding the dt2 to the bottom of dt1.

Here is the exact requirement:

1)I data scrape a table dt1 which has 3 columns
URL | Employer ID | Employer Name

When i click on the URL it just navigates me to another table dt2. There is a search bar above that table and I set text (Employer ID + Employer Name) into that and it generates table dt2 with columns

Employee name | Start Date | End Date | Status.

I can scrape dt1 and dt2 independently and write it to csv.Seems like i’m not finding a way to merge these tables together based on search parameter.

Thanks.Hope it is well explained.

1 Like

This should look like this:

  1. Scrape of Table1 → assign it to DataTable (dt1)
  2. For each element from column “URL” navigate to it.
  3. Table2 is opening
  4. Click into search bar end enter data from dt1 (ID,Name)
  5. Generate table
  6. Scrape generated table → assign it to DataTable (dt2)
  7. Use write range to create new file which will have data from dt1 and dt2.
1 Like

I tried this and it is writing dt2 beneath of dt1.

1 Like

What you can do is also build new DataTable and using loops write data from dt1 and dt2 to the rows/columns you need. And finally write this dt3 to the Excel/Worksheet.

1 Like