I have a for each action in my power automate desktop flow. I am needing to incorporate an On error on action within the for each action. I am wanting the On Error to restart at the For each action. The On error will be within the Subflow. If it errors out, I want the flow to go back to step 19 and go to the next account number. Thanks for any help with this!
Solved! Go to Solution.
So new lesson learnt today - Variables are of global nature in PAD and Labels are not 😊.
You can use set variable instead.
In the on Error in the subflow, set a variable like varFlag = 1. Depending on how you have designed the subflow you might also have to select "go to end of block"
Then in the Main flow add your "If" in such a way that it bypasses everything and goes to the End statement
For each
run subflow ("")
If varFlag= 0
do something
End if
End
so If you set varFlag to 1 in Subflow, it will not go inside the IF and directly go to the End which will be your next iteration of the For loop.
Cant see at which line the "End" statement of the For each loop is.
Add a Label just before the "End" statement.
Then in your subflow, the On error has an option called "go to label". So when it encounters an error it will jump to the label which is your next iteration of the For each loop.
Hey @VJR ! I created the label but when I go to on error I do not see my created label. Am I doing this wrong?
I noticed when I use the on error on an action within the subflow it does not show my label. But if I use an action in my main flow I see the label.
So new lesson learnt today - Variables are of global nature in PAD and Labels are not 😊.
You can use set variable instead.
In the on Error in the subflow, set a variable like varFlag = 1. Depending on how you have designed the subflow you might also have to select "go to end of block"
Then in the Main flow add your "If" in such a way that it bypasses everything and goes to the End statement
For each
run subflow ("")
If varFlag= 0
do something
End if
End
so If you set varFlag to 1 in Subflow, it will not go inside the IF and directly go to the End which will be your next iteration of the For loop.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Announcing a new way to share your feedback with the Power Automate Team.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.