Searching data, inputting into an excel

Hi UiPath,

Apologize. I was busy trying to rectify and was away as well

So basically

  1. I want RPA to prompt user to enter data
  2. After entering data, RPA will key in to a search bar(i.e google)
  3. If data matches, it will input details into an excel
  4. If data has no return, it will not key in any item in the excel and prompt user to check data
  5. Close

I think I can use this as an example to tune to my RPA

@chting

Use an Input Dialog, Store the input in a variable.
Use the “Open Browser” activity and Use the “Type Into” activity to enter the user-provided data into the Google search bar.
Use a “Find Element” or “Find Image” activity to check if there are search results on the Google page. If search results are found, you can proceed; otherwise, prompt the user to check the data.
If search results are found, use activities like “Data Scraping” to extract details from the web page.
Store the extracted data in variables.
Use the “Write Range” activity to write the extracted data to an Excel file.

Cheers…!

Let’s go one by one

  1. For this use a INPUT DIALOG BOX activity and give the user a prompt and get the output as a string

Now use a USE BROWSER/APPLICATION activity and use a type into activity with the above obtained string as input

Use element exists or check app state activity to validate any element or availability of data

If yes then use GET TEXT activity and save the data as a string which can be added to a excel using WRITE CELL activity or create a datatable with BUILD DATATABLE Activity initially with column you want and pass the value obtained with get text activity using ADD DATAROW activity which can be later written to excel with WRITE RANGE activity
Or
Here you can use TABLE EXTRACTION

Hope this helps

Cheers @chting

Is there a way if I can remove data row? I have program everything to key in to an excel actually.

And if it does not come up with a find, it will remove the data row

1 Like

HI @chting
We have “Remove data row” activity you can make use of it and remove the data row

Here you can use a simple linq query here like this using a assign activity

dt = dt.AsEnumerable().Where(Function(a) NOT a(“yourcolumnname”).ToString.Contains(Strinput.ToString)).CopyToDatatable()

This will remove the rows if a specific value like Strinput is not found under a column

Strinput is the one that you are actually searching for in web

While iterating through each row we can’t use REMOVE DATAROW activity as it will throw error

Cheers @chting