Read excel cell and interact on webpage

hi friends,
let me make this as clear as possible. i have excel sheet with a name in each cell. i want my robot process to read what is on the cell and then find it on the webpage and do click on it there. is there way to do this. each cell is different so must first find the same text on the webpage and then preform a center task like clicking.

Using Ui Explorer, click one of the names on the web page and post a screenshot of what Ui Explorer gives you.

Basically what you’ll need to do is read the Excel file into a datatable (Read Range), then For Each Row in Datatable through it, and build a dynamic selectors from the datatable value to have the Click selector find the correct name.

is there any videos or resources that shows this in more detail.

I will show you in detail, but you should do the free online classes on the UiPath web site. They teach you these things, which are pretty basic things (reading from Excel, dynamic selectors).

Using Ui Explorer, click one of the names on the web page and post a screenshot of what Ui Explorer gives you. Do that and then I can give you more detail.

and am i able to make this process dynaimc as the cells change.

Yes. But I need you to show the selector Ui Explorer gives you, to show you how to make it dynamic.

hELLO @Shazid_Rahman ,

You can refer to the below video for understanding how to pass the dynamic variables to the selector. Here in the webpage what you need to do is, using ui explorer try to identify an attribute which hold the same values as that in the excel.

For example from the excel you are getting a value as Button1, inorder to identify that one in webpage some attribute should have that value; for eg: aaname=“Button1”. …If that is the case you can get the values from excel and pass it to aaname. Then it will work.

ok so i undserstand howto make a dynamic selector but, i dont which varibke should change to make it dynamic.

I’ve asked you repeatedly to show us the selector. If you don’t, we can’t tell you how to make it dynamic.

sorry about that this is the picture of the selector that i am trying to make dynamic based on the excel data. the thing the element also may not be in the same area. so it changes in name and location. i just want my robot to click the element that says exactly what the excel file says.

Assuming you are in a For Each Row in Datatable loop with the identifier as CurrentRow, and the column is named “Name” then you’d change:

"<html app=chrome.exe" title="Bla/J - Records | WebPT" /><webctrl aaname='R Hip 2021' tag='BUTTON' />"

To:

"<html app=chrome.exe" title="Bla/J - Records | WebPT" /><webctrl aaname='" + CurrentRow("Name").ToString + "' tag='BUTTON' />"

Put that into the Selector of your Click activity.

Hello @Shazid_Rahman

Here from excel which value are you getting?? Can you confirm that is aaname?? Else plz share the screenshot of the excel. If it is aaname do as below.

Use for each row in Datatable activity
Use assign activity and get the value to a variable for example: MyVar= CurrentRow(0).ToString. ( here I’m assuming you are getting the required value from first colum,you can change as required)
Use click activity and click on one element which you want. Then open selector and replace the value of aaname with MyVar … Right click and select the variable in the selector

Now your selector is dynamic and can work based on the value from the excel.

There’s no reason to assign CurrentRow(0).ToString to a variable. That’s an extra unnecessary step. Just use CurrentRow(0).ToString in the selector. Also, it’s better to use the column name rather than index. Easier to understand what it’s doing when you look at it later, or someone else does.

Assign to a variable and using it in the selector will help to reduce the unnecessary string conversion and all inside the selector, which can throw unwanted errors in the selector.

I always prefer to assign to variable and use it in selector. :slightly_smiling_face:

when i input that into the selector it says its not vaild

You don’t put it into Ui Explorer. You put it into the selector of your Click (or any other) activity.

im sorry i am new to this, where do go to put it.

i dont understand what you mean put it inside the selector