Iterating through buttons with I'd {variable}

Hi again

Power bi dashboard with about 100 plus buttons each representing a client, I can use the Id={variable} to successfully iterate through but when I get to the end, I want the robot to stop and because I don’t know the count beforehand I can’t set an end counter, anyway of knowing when the bit reaches the end?



There is a sql backend so I could get a count before hand, but just wondering whether there is an alternative?

Much appreciated

Hi @philwaller,

if you have used loop, then use below workflow

1)Check the element
2) if true click or break the loop



@philwaller ,

You can use data scrapping. It will take auto count. Once done it stops the loop.

Pavan Kumar

Hi , thanks for coming back to me

This isnt a data table or a web app
this is a desktop app , so i would have to build a data table as i iterate?

Thanks again !


Hi @philwaller

you can check if element exit with the dynamic selector you have created. if element exist you can go ahead with your flow if not exist that means you have iterated through all of your buttons and can stop the loop

Thanks again

Let me give it a go



Hello @philwaller

I hope you are incrementing the counter variable and using it as an attribute in the selector.

The in the iteraction as the last step use an element exists and check for the presence of the next iterative element, then use an if condition, if false then exit from loop.


I am incrementing the counter yes, but I have hit another hurdle and its non UiPath related!!