Clicking each row of a specific column in a table on a website

I want to click each row of the column “Dokumente”.
My current solution is to do a Data Scraping of the table (selecting column “Dokumente” and one other column).
Then I implemented a “For Each” activity referring to the output variable (DataTable; Default: NewSystem.Data.DataTable) of the Data Scraping.
Then I come to the first issue:
The “Double Click” I implemented thereafter is not working. The robot always clicks the first row (in a loop --> so it would be endless without any progress)
So what do I need to adjust in order to let the robot check/click every row to the end?

I very much hope that someone can help me…!

Those elements with letters - A G S Z in row 1 for example - are all going to have similar selectors, with likely a single difference in a particular attribute. It could be ‘inner text’ for example which is set to A, G, S, Z etc for each element respectively.

You can use the Find Children activity to return a list of all those elements on the table and then filter that to return only those which contain the attributes common to A G S Z etc.

You should then have a list of all letter elements in the table. You can do a ForEach on all of these. This would contain a GetAttribute Activity and then an IF statement similar to:

FOR EACH element IN List:

Assign
InnerText = GetAttibute(‘innerText’)

IF InnerText = ‘U’

THEN DoubleClick

ELSE DoNothing

It can be difficult to initially grasp the use of Find Children but it can be a very powerful method to scrape and analyse data on web apps.

1 Like

Hi @ronanpeter,
thanks for your quick reply.
I have to points which might lead to conflicts or further issues.
First, the table is bigger than the screen so that it’s scrollable. Thus I used “Data Scraping” in order to grasp all the rows. Is “Find Children” able to also search for elements which are not visible on the screen? Or do I have to combine “Find Children” with “Data Scraping”?

Second, it’s not intended to double click on the letter itself since then the document will open immediately.
But I want the request itself to be opened. So I have to double click on any other cell in this row.
So how can I assure that the robot double clicks the correct row even though he has to click in another column?

hi MarcJo,

When you do the datascraping do you also scrape the url (that is called when you click the row), you could use this when you find a U in the column to open a webpage/browser

Find Children should be enough. No need to combine with Data Scraping. You may want to initiate scrolling down activities on the table before the Find Children is invoked as the full table will need to be loaded. However, that should be straightforward.

As for your need to click on any other cell on the table row, with regards to the letter elements, their selectors will have some indication of which row they are situated on. it is difficult to say what that will be, but I expect it should be obvious. Just compare, for example, the selector for A in row 1 and the selector for A in row 2, what attribute is different? I expect that attribute will also identify which row the other elements in, for example, column ‘Eingang am’ sit. Then you have your row identifier. Grab this when a ‘U’ is identified by your IF statement.

So instead of clicking the letter, once a ‘U’ is identified, simply use a selector with the shared attributes for the data in ‘Eingang am’, then feed it a row number variable into the row identifier attribute to click.

It may sound a little difficult, but its not. Just break it into its logical steps and it is quite straight forward. Nothing too complicated.

Hi @ronanpeter,
the requirements changed so that there is no more need for a character check.
It’s only necessary to click each row.

But I still face an issue…
After doing the Data Scraping and then adding a “For Each Row” activity (including “Click” on a specific column’s cells) the robot always clicks on the first row only. The selector I chose is as follows:

grafik

Even though I replaced the row’s number by * it’s not working.
What else do I have to do to make the roboter clicking on each row.
I thought the “For Each Row” should be enough. But apparently not…
Thanks in advance

Hi, @MarcJo

DataTable = For each row
Then scrap table

YourString=row(3).tostring

Then use IF
YourString.contacins(“u”
Do your work
Else
So nothing

That selector will click on the first element which matches the syntax provided. In this case it will always be the first row. If you want to click on each row in the table one by one, then you should possibly change the wildcard to a variable which represents the current row to click on.

Hi @ronanpeter,
I now implemented a way to extract all row items in a specific column:


In the output I see all the numbers which are saved in the variable (string) “Antragsnummer_aus_Tabelle” (marked yellow in screenshot above):
grafik
Then I try to click on this number (“Click Text” activity with the variable “Antragsnummer_aus_Tabelle”) with a selector ranging over the whole table:

However, I receive this error message:
grafik
And I have no clue why?
What do I need to change?

There may be issues ongoing with the Click Text activity and bugs being identified.

I would suggest just using a click activity rather than ‘click text’.

Each of your Antragsnummer items will have similar selectors with just a variation in the attribute for the number itself, possibly innertext. You can create a selector for each number by adding a variable to replace, for example, innertext and place this alongside the common attributes of the Antragsnummer selectors. This can be tested using the UIExplorer to verify your selector syntax

Hi @ronanpeter,
thanks for your continuous support.
I changed the activity to “Click” and it is at least working for a specific number - means it’s looping the number infinitely. So far so good:

Then I changed the number (‘innertext’) in the selector to the string variable “Antragsnummer” in order to click through all rows (via right click and “Choose variable”).
But then the validation of the selector fails:

I also tried for ‘aaname’ but result was the same.
Do you have any other suggestions?

Unless you are on the latest version of UiPath, I do not believe the functionality to add a variable in the UiExplorer selector properties like that will be available to you.

You should edit the selector for the click activity in the properties window rather.

try that and see if it works for you.

Hi @ronanpeter,
I kept trying out different variants and it finally worked with this Selector:
grafik
Thanks for your help!

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