Hello! I´m developing a automation to create tickets in a platform, and I need a loop to do it. The idea is that thw bot will ‘see’ if that is still a ticket on the list that is in the platform and if there is, it should click in the name and create a ticket for this person, it should do this untill there is no one left on the screen, and when that happens the execution should be over. How can I do this, since I already have the process completed and this “activity” is the only thing that is missing? Thank you sm!

In a situation like this where items disappear from the list each time I process one, what I do is just get the first item from the list, process it, return to the list, get the first item, process it, etc…

You can use a Check App State to make sure there is a first item. Usually “first item” will be identified with a selector that includes the tableRow property.

Do you have a printscreen?

Nothing that would be specifically relevant to the application you’re working in. But here is an example of a “get first item” sequence I use in one of our apps. Note that this is in a library/custom activity so that’s why you see it referencing out arguments.

First I create a Dictionary to store all the values in.


Then I use Table Extraction to get just the first row:


The key here is telling it to only pull one row:


For this automation I also need the UI Element for a link that needs to be clicked, so I grab that object and store it in an argument separate from the dictionary:


This is the selector:

"<webctrl aaname='Claim' parentid='gridTable' tableRow='{{firstItemTableRow}}' tag='A' />"

(I use firstItemTableRow because this app is a little weird, if there is more than one page, there is a navigation header so the first row of data is tableRow 3 but if there is only one page then there’s no navigation header so the first row of data is tableRow 2, and so the value of firstItemTableRow is set ahead of time)

Then I convert the Table Extraction datatable into a dictionary.


But you don’t necessarily have to do this. All the data for the first item is in the datatable. It’s just that for my needs I convert it to a dictionary.