Good Day,
I have completed my Flow in Power Automate Desktop and am now looking to implement a try-catch error block for error handling.
It should work as follows:
- An error occurs.
- The Try-Catch block triggers a Sub-Flow.
- The user can identify the cause of the error and rectify it. Afterwards, they are presented with a dropdown menu to select the step from which they wish to continue. It's important that the previous steps and variables remain unchanged.
I've made some progress, but I'm unsure about what to input in the 'if' functions. I tried initiating the subflow, but it doesn't return to the desired step in the main flow.
Your assistance would be greatly appreciated.
Best regards,
You cannot really define the step for the flow to continue from dynamically. You will need to hard-code every possible option and have some form of stage functionality implemented.
The way I would do this is more or less as follows.
The main flow should be done within a WHILE 1 = 1 loop, so that it continues infinitely, until you tell it to stop. This way, if an error happens, you can start from the beginning.
Then have an On block error to handle the catch part. And then have conditions for each step. If the stage is complete, the step should be skipped.
Then, once all stages are completed, you can use Exit loop to stop looping.
It should look somewhat like this:
Make sure that your On block error action is set to call the sub-flow, as well as continue the flow run and go to the end of the block. This way, it will skip further actions on error and get back to the beginning of the loop.
Then, your sub-flow should basically set the %Stage% variable to one step before the action that needs to be taken next, depending on the choice that the user made.
So, when the flow exits the sub-flow, it will get back to the loop and proceed with the action the user selected.
-------------------------------------------------------------------------
If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.
I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.
WarrenBelz
146,745
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,091
Most Valuable Professional