cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
GhitaFjorback
Advocate I
Advocate I

PAD output variables doesn't output on error!

Hi,

Why on earth doesn't output variables work when desktop flow errors?
I have an error block set for a "MainErrorTask", and in the block I am, closing open windows and files, setting output variables with i.e. loop no, row no. etc.
In my Power Automate flow, where the desktop flow was triggered, I then have a "if action failed" run desktop flow again, and I have input variables with the values from the output variables, this way my desktop flow can start again, and automatically navigate to the correct loop, row etc. - I am doing this, since sometimes all that went wrong was a webpage that did't load properly or something like that, and running the desktop flow again will not result in an error. I of course have a maximum of re-runs set in my flow, and emails notifying me etc, but as the output variables doesn't populate in cases of errors, then this won't work!

As a workaround I choose "Continue flow run" instead of "Throw error", and then in my subflow MainErrorTask I am ending it with a "Stop flow" action, but this is really not neat, as it will show my flow history as all went fine with the flow, which it didn't!

This is definitely a feature request!

Thanks
Ghita

1 ACCEPTED SOLUTION

Accepted Solutions

My issue got solved with one of the latest updates to PAD. Using the “Get last error” and stopping the flow with a message. I am a happy camper now.

thanks for trying to help out though.

View solution in original post

5 REPLIES 5
joshd111
Resolver I
Resolver I

@GhitaFjorback It's hard to figure out from your description. Please clarify what input and output variables you mean in the sentence "input variables with the values from the output variables"

Rohith_Raju
Microsoft
Microsoft

Hello @GhitaFjorback ,

Based on your Description, if my understanding is correct, you are trying to use Error Handling in case the Flow fails in PAD.

 You can use  "Continue Flow Run" and On Error "Go to Label" where you can set the Label, pointing to an action where you want the Flow to start from again

image.png

Else as an alternative, you can also use the repeat action, in which case, the action repeats itself until the Application or Browser loads with correct data.

image.png


For the Query related to variables, you may find helpful content in the below Docs:

https://docs.microsoft.com/en-us/power-automate/desktop-flows/manage-variables
https://docs.microsoft.com/en-us/power-automate/desktop-flows/variable-manipulation



GhitaFjorback
Advocate I
Advocate I

My whole issue is, that I want the PAD flow to Throw and error! Even though it is throwing the error, I still want my output variables to output values! This is the issue. If I set the Error block to:
1. Set variable (my output variable)
2. Throw Error

 

The output variable is EMPTY.

If I set my Error Block to:

1. Set variable (my output variable)

2. Continue Flow Run - Run subflow
3. In the Subflow I will end flow

 

The output variable is set correctly, but my Flow will think (correctly), that the PAD flow ended successully!

I want:

1. PAD flow to end with throwing and error

2. Get the value of the output variable

I hope I have made myself more clear now. :0)

Rohith_Raju
Microsoft
Microsoft

Hello @GhitaFjorback ,

Thanks for the details.

If I am right, Data to the Output variable is written only after successful completion of the action. 

When an action fails, immediately an error is Thrown, even before the Output variable can be updated, hence leaving the Output variable empty or Null value.

If you try to skip the action, using Error Handling, then the Action as well as the Output variable pertaining to that Action is jumped without any value to the Output Variable.

Either way, it is mandatory for the Action to be completed in order to Populate a value to the output variable.
Else the Output variable will not be able to Output values. 


My issue got solved with one of the latest updates to PAD. Using the “Get last error” and stopping the flow with a message. I am a happy camper now.

thanks for trying to help out though.

View solution in original post

Helpful resources

Announcements
User Groups Public Preview

Join us for our User Group Public Preview!

Power Automate User Groups are coming! Make sure you’re among the first to know when user groups go live for public preview.

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Users online (41,921)