Skip to next row in For Each Row based on outcome of Find Image


I’m trying to automate installing apps. I have the app names in an excel file which I loop through with for each row. When the name is inputted into the search filed I use find image to look for the install button which I then click. This is working fine but I would like to add error checking where if the app is already installed the 'install; button is replaced with ‘open’. In this scenario i would like to skip the rest of the sequence and move to the next row in the excel file. Please could someone give me some pointers in how to achieve this?

Thank you for any help.

Hello @kjhsdhkfskh ,

In a for each row scenario, to skip the current item , the best is to use the Continue activity.

Ofcourse, you can used in a If situation.

If Install, click install
if Open , Continue

I hope it helps…


1 Like

HI @wasea

Thank you for the quick reply. I wasn’t aware of the Continue activity so that is really helpful. Do you know how I would use this in conjunction with the If and Find Image activity? I cant use the Find Image directly in the If condition. Is there a way in which I can store the positive detection on the ‘Install’ image in a variable and the use something like If installImageVariable = True Then move to next step. Else Continue to next row?

I hope this makes sense?

Find Image, as far as I know, cannot be used in a If condition.

I recommend, if possible for you to use Element Exist or Get Attribute activity.
These activities can be used with If activity.

I hope it helps…


1 Like

Thank you @wasea that worked perfectly.

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