Need help extracting correct tableRow using dynamic selector in UiPath

Hi friends,

I need your help or suggestions regarding a dynamic selector issue in UiPath.

Here’s my original selector:

And this is the dynamic selector I’m using in a GetAttribute activity to fetch the tableRow value:

Issue:
I want to extract the tableRow value of the second line in the original selector (i.e., 5), but I’m getting the value from the third line (i.e., 2).

Has anyone faced this before? Is there a way to fetch the parent tableRow instead of the child using GetAttribute? Or do I need to restructure my selector or approach?

Any ideas or workarounds would be much appreciated!

Thanks in advance!

Hi @vighneshgadekar

If the element is part of a structured HTML table, it’s more efficient to use the ‘Extract Data Table’ activity. This allows you to extract the entire table and then directly access the row you need using standard DataTable methods.

Hope this helps!

Hi Sanjay,

Thanks for your response.
But table is unstructured and rows are dyanamic. I want to fecth the surcharge name present in that table and using that row number I want to insert the value in respective column.
The row number present in 3rd line changes column to column but the row number present in 2nd line of selector is constant throughout that row. so need to pull it out and using that row number I will fill the value.

@vighneshgadekar

From myside i can sum up these points

Looping through all rows using Find Children on the container that holds all the rows.

For each child (i.e., table row), use Get Text to check if the surcharge name variable value exits

Once found, use Get Attribute on that child row to fetch the constant tableRow value.

Now that you have the row number (e.g., 5), dynamically construct your selector to enter data into the correct column of that row.

Hope this helps

Hi Sanjay,

I tried doing find children as well as using anchor base find element & Get attribute but unable to solve the issue.
How ever I am able to fix it I will share below what logic I implemented.

The solution I implemented here is using find element activity and providing direct surcharge name as input I am able to pull out its full selector as UiElement.

Then using its outputElement.Selector.ToString and string split option(“><” as delimiter) divided that full selector in multiple lines array.

Since I know I want to extract TableRow present in 2 line of full selector, I passed Array[1] as input selector in GetAttribute activity & obtained my required value.

Closing this query from my side Since I am able to fix it now.

1 Like

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