web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Need help! “If this th...
Power Automate
Unanswered

Need help! “If this then that, but on error do this, on success do this”

(0) ShareShare
ReportReport
Posted on by 5

So I am new to power automate, and new to coding in general. My skills are limited to what I have learned using raspberry pies for a year and a half, lol, so not much experience! I have a very simple flow that I am trying to build. Essentially my flow is a GUI automation overlay over a blue stacks five phone. I am essentially trying to automate a handful of apps that are android specific. Like I said it is very simple, it is essentially just a bunch of daily check-in‘s, and daily log in and click this button.  My problem is ads! I am trying to automate bypassing the ads, no true ad blocker exists for apps running on bluestacks (that I am aware of). So I have to automate watching them, exiting out of them, and re-initializing the app. I am open to easy suggestions by the way or other ways to do this! My current problem, is I am trying to  run a couple of image checks before specific actions. My current idea is to use “wait for image” (The image is an isolated part of the ad, basically the location of the X, It changes location) To scan the screen. When it doesn’t find the image I want it to run a sub flow to scan for other images. This subflow would ideally contain a set of images that would contain a match within one of them. When the image is found (in the subflow using wait for image) I want to run “move mouse to UI element and left click”. The click is always successful, but I need the main flow to resume upon a successful “wait for image” AND left click action, instead of continuing the rest of the sub flow to go through the other images to scan. How can I achieve this. Any help or suggestions would be greatly appreciated! 🙂 

I have the same question (0)
  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    If the UI element is always successful, then I would drop the "wait for image" and say:

     

    If window element exists (UI element 1)

        click window element (UI element 1)

    End(If)

     

    If window element exists (UI element 2)

        click window element (UI element 2)

    End(If)

     

    If window element exists (UI element 3)

        click window element (UI element 3)

    End(If)

     

    Good luck!

  • MrCrypDough Profile Picture
    5 on at

    I probably should have specified the UI click is only successful because the screen coordinates are programmed to each each matching image from “wait for image”. The window UI elements do not work for most of the elements within the apps on bluestacks. The image functions are the only ones I can get to work for bluestacks GUI manipulation. It is just not always the same image at the same action in the flow.

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    Okay.  Then same logic, just "If image exists, click image" instead.  This will also take longer, because it has to scan the whole screen for the image each time.  If you can, use the "search on specified subregion", so it knows where to look specifically, and this will reduce the time it takes to get through each "if image".

  • MrCrypDough Profile Picture
    5 on at

    No longer require the use of a flow that runs this way. I was able to bypass half of these steps with 100% accuracy by using send key inputs on power automate to initiate an automated macro recording that is built into bluestacks. Now there is not need for a double or triple decision fork at a single action. I scan for if image exists then proceed with flow and if error then run macro and wait for image to appear to run second macro. Works every time. Thanks for help everyone! 🙂

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 386

#2
Valantis Profile Picture

Valantis 342

#3
Haque Profile Picture

Haque 336

Last 30 days Overall leaderboard