Dynamic UI element table - Please Help


My problem is somewhat similar to: [Need to iterate through a dynamic UI element table]

I am needing to input values from an excel sheet into certain UI elements in a web-based table.

I am using a for each excel row activity, and per the attached xaml file, you can see what I am attempting.
Dynamic_UI.xaml (57.2 KB)

I have the copy and pasting from the excel sheet into the “product ID, Description, and Unit price” UI elements figured out. The part that is puzzling me is the following:

When the automation clicks the red plus sign, it successfully adds a new row, but:

It will keep adding rows as it goes through the excel spreadsheet, but it will just overwrite the first row until it is done:

I have uploaded the excel spreadsheet and the xaml in case anyone would need to look at that.

Forum_spreadsheet.xlsx (10.1 KB)

Any comments/guidance are much appreciated. Please let me know if anyone would need anything else to clarify what I am trying to accomplish.

Hi @Sc100,

Welcome to community.

I couldn’t check the selectors because I couldn’t reach the page.

My advice is to dynamically the selectors you use for the data entry activity.
Since you will be entering transactions for each row here, look for a row count selector that you can increase in the selectors.

Dozens of tests on selectors may be required. Therefore, it is very difficult to support remotely. Therefore, I can only give advice.


1 Like

Hello @Sc100

Here if you want to add new rows by clickin gon + button and need to add data to the newly created rows, then you need to identify the proper selector for the each cell.

What you can do is use Uiexplorer and inspect on the cell, there you should be able to find some attrbiute like idx or rownum, which is dynamic and incrementing for each row.

That attribute value you need to replace with a dynamic counter variable and you can type.

1 Like

U should make Selectors dynamic.
you can increase the rows by passing a variable counter in selector, then you can increment the counter every time you add a row until some condition is met. :slightly_smiling_face:

1 Like

Muhammed, Rahul, and Loveleet,

Thank you so much for your replies. I will attempt this, and will post screenshots/code of what I did come up with.

Many thanks again. Talk to you all soon.

  • Sean
1 Like

Good day,

After having spent a few hours on various tutorials, I have made some progress, but still have questions.

Dynamic_Selector_Increment_Row.xaml (28.8 KB)

Forum_spreadsheet.xlsx (10.1 KB)

  1. I am not sure if the “click” needs to be before the assign activity, or after.
  2. So far, I am getting the following error:
Get Text: Could not find the UI element corresponding to this selector:
[1] <html app='firefox.exe' title='***** !!! Application - Financial Model'/>
[2] <webctrl id='tblEquipment' tableRow='2' tag='TABLE'/>
[3] <webctrl id='update_productId' tableCol='6' tableRow='0' tag='INPUT'/>

Search failed at selector tag:
[3] <webctrl id='update_productId' tableCol='6' tableRow='0' tag='INPUT'/>

The closest matches found are:
[75%] <webctrl id='update_productId' tableCol='6' tableRow='3' tag='INPUT'/>
[57%] <webctrl id='update_margin' tableCol='16' tableRow='3' tag='INPUT'/>
[41%] <webctrl id='update_discription' tableCol='7' tableRow='3' tag='INPUT'/>
[41%] <webctrl id='update_markup' tableCol='14' tableRow='3' tag='INPUT'/>
[40%] <webctrl id='update_upp' tableCol='8' tableRow='3' tag='INPUT'/>
[40%] <webctrl id='update_custt_disc' tableCol='15' tableRow='3' tag='INPUT'/>
[40%] <webctrl id='update_un_per_site' tableCol='11' tableRow='3' tag='INPUT'/>
[40%] <webctrl id='update_*****_disc' tableCol='10' tableRow='3' tag='INPUT'/>
[39%] <webctrl id='update_sites' tableCol='12' tableRow='3' tag='INPUT'/>
[39%] <webctrl id='update_otherSupplier' tableCol='5' tableRow='3' tag='INPUT'/>

Please note: Used “*” and “!” for security purposes. Do not want to disclose company name.

Here are screenshots that will hopefully help:

Again, here is the UIElement I am targeting:

And here is the UI Explorer selector information:

So, in the “assign” activity inside of the “for each excel row”,

I had taken the selector code which was initially:

"<html app='firefox.exe' title='***** !!! Application - Financial Model' /><webctrl id='tblEquipment' tableRow='2' tag='TABLE' /><webctrl id='update_productId' tableRow='3' tag='INPUT'/>"


"<html app='firefox.exe' title='***** !!! Application - Financial Model' /><webctrl id='tblEquipment' tableRow='2' tag='TABLE' /><webctrl id='update_productId' tableRow='"+Counter.ToString+"' tag='INPUT'/>"

Note I had replaced “tableRow = ‘3’” to "tableRow= ’ “+Counter.ToString+” ’

For reference, I had mainly used this tutorial:

I really appreciate the help and guidance on this one! If I can figure out how to master this area of dynamic selectors, I feel like I will be on my way to mastering RPA with UiPath.

If anyone needs any additional information from the UI Explorer or anything else, I will be more than happy to provide.

Thank you again! :blush: