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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to repeat a flow u...
Power Automate
Suggested Answer

How to repeat a flow until a condition is met?

(1) ShareShare
ReportReport
Posted on by

I am trying to login to a portal, but the portal has a bug where if i login the first time using my username and password it will show login fail. So i have to enter my credentials again and login and do this steps multiple time until i can login. So i am trying to use PAD to do this where i want it to keep on trying to login until successful.

 

For example, this is my current flow:

zau73_0-1721096085073.png

i want it to go back to step 5 and try again if step 7 fails. How can i do this? Please advice. Thank you.

I have the same question (0)
  • eetuRobo Profile Picture
    4,204 Super User 2025 Season 2 on at

    Most actions have "On error" option in them. 

    eetuRobo_2-1721097635354.png


    There is a toggle "Continue flow run" so the flow does not fail if error happens in that action. Then you can select Exception handling mode like "Go to label" (you first need to have a label added in the flow).

    eetuRobo_3-1721097729482.png

     

    Add label just before the action 5

    eetuRobo_4-1721097866770.png

     

    But I think your "Press button" -action wont fail since that's just a button that you press to login so it has not yet tried if the username/password is correct. I would add "Wait for web page content" -action to make sure the login was successful. And if that fails then On error goes to label (so back to populating the username/password). Remember to add Fail with timeout error and some amount of duration for it to wait before going to error.

    eetuRobo_1-1721097598475.png

     

    On error:
    eetuRobo_0-1721097538021.png

     

  • Suggested answer
    AK88 Profile Picture
    453 on at
    Hi Paul,
     
    As mentioned by eetuRobo, you can use label and go to actions to do the looping, so each time when the credentials login failed, and also you can do Retry policy from the action to check the item.
     
  • Suggested answer
    Sayan Profile Picture
    818 Super User 2025 Season 2 on at
    You can try with the following approach - 
     
    Step 1:
     
    After launching the browser, we enter the username and password, and then press the Login button. Put these three actions inside a region and place a label over the region.
     
     
     
    Step 2:
     
    Use the "If Page Contains" action, and inside this action, use the UI element that should appear after a successful login. Inside the Else Condition use go to Label and Choose the Label that you marked above the Login Region.
     
     
     
     
     
    Main Workflow:
     
     
     
    -----------------------------------------------------------------------------------------------------------------------------------------------------
    Thanks,
    Sayan Patra 
    RPA Developer
     
     
    If my suggestion helps you, please gives it a Thumbs up  and Marks as a Solution which motivates to solve more problems. 
     
     
  • MichaelAnnis Profile Picture
    5,727 Moderator on at
    @zau73, if any of these solutions worked for you, please mark them as a solution; otherwise, please update us on what your current status is and what you need help with.
     
    Thanks,
     
    Mike

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard