Matching Serial Numbers in Table With Excel Sheet

Greetings, this is my first post here. i have a bit of experience with UiPath but i’ve only made simple stuff with it.
anyway i have a website that has computer assets listed with their serial number that looks like this…
image
i also have an excel sheet with serial numbers on it stored on my computer
i want to setup an automation that looks at each serial number in the excel sheet and if it matches one from the web table, it checks that box on the left (which is the first column of the table actually)

the issues ive encountered trying this so far is after i select the table and save it for later, im not sure how to access the table’s data when im doing the for loop in excel. ive read i can save it to the notebook but even then, how do you have UiPath dynamically set the anchor point to be the serial number in the 5th column and check its corresponding checkbox?

my company only gives me access to StudioX so i cant do any Studio-only things.
thanks in advance to anyone who replies.

  • For Each UI Element - indicate the Serial numbers
    – For Each Row in Data Table
    — If CurrentElement = CurrentRow(“columnname”).ToString
    ---- Get Attribute “tableRow” for CurrentElement
    ---- Use the Check/Uncheck activity and use tableRow to make it check the one in the same row

@zrhodes

  1. For each row in datatable
  2. Inside loop use check app state with dynamic selector
  3. On found side use click with dynamic selector

Selector will be something liek this

Check app state selector

<webctrl tag='Table' />
<webctrl tag='td' column='5' innertext='{{currentrow("ColumnName").ToDtring}}' />

Click selector

<webctrl tag='Table' />
<webctrl tag='td' column='5' innertext='{{currentrow("ColumnName").ToDtring}}' />
<navup />
<webctrl tag='td' column='1' />

These are for illustration

Cheers

im using StudioX, when i look for the “For Each Row in Data Table”, its nowhere to be found. is this a limitation of StudioX or is it a thing my company imposed or something? Is there a workaround for this in StudioX?

im using StudioX, when i look for the “For Each Row in Data Table”, its nowhere to be found. is this a limitation of StudioX or is it a thing my company imposed or something? Is there a workaround for this in StudioX?

@zrhodes

I DO NOT have “For Each Row in Data Table” activity. i understand that most users do but i promise i do not.
so im thinking i need to do it like this…
for each row in excel
if the text in the excel is on the page somewhere, use that as anchor and select its corresponding checkbox.

how would i go about doing something like that?

If you have UiPath.System.Activities installed in your project, you have For Each Row in Data Table.

i have figured out a way to have it highlight each serial number with this

String.Format("<webctrl id='ctl00_ContentPlaceHolder1_gvResults' tag='TABLE' /><webctrl isleaf='1' type='' aaname='{0}' tag='TD' check:text='{0}' />", serial_number)

when i look at the selector editor for this serial number i see it says

<webctrl id='ctl00_ContentPlaceHolder1_gvResults' tag='TABLE' />
<webctrl isleaf='1' tableCol='5' tableRow='2' tag='TD' />

the corresponding checkbox has this

"<webctrl id='ctl00_ContentPlaceHolder1_gvResults_ctl02_ckbSelect' tag='INPUT' type='checkbox' aaname='' />"

that “02” part clearly matches the tableRow. so my question is how do i save the tableRow value as an integer to a variable and use that as an argument in the checkbox activity to change it?

how would i locate it then?

The checkbox will also have a tableRow attribute you can use instead of ID.

"<webctrl tag='INPUT' type='checkbox' tableRow='" + yourTableRowVar + "' />"

image
when i select the the first checkbox and look at its selector attributes, i do not see any tableRow.

If it’s in a table it has to have a tableRow attribute. Open it in UI Explorer and you’ll see all the unused attributes that you can select. It’s important to understand how to use UI Explorer to modify selectors. What that indicate window gives you isn’t all that’s available for the UI element.

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