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 / On Error, send an emai...
Power Automate
Unanswered

On Error, send an email with the Error message?

(0) ShareShare
ReportReport
Posted on by 338

Hi,

 

I have an always-on VM with some Power Automate Desktop attended flows triggered by a scheduled flow. 

Currently, I have a Subflow that runs after any error is encountered which takes a screenshot then emails it to me. 

Capture2.PNG

 

What I'd also like included in the email is the actual error message from the error that was encountered, but I can't figure out how to pull the info.

So how would I have it email me, for example, the below runtime error?

Capture.PNG

Thanks

I have the same question (0)
  • PetrosF-MSFT Profile Picture
    Microsoft Employee on at

    Hi @Cayshin 

     

    Within the error handling window of the Action that calls the "Error report" subflow, you could try setting the possible error into a variable (before calling the subflow).

    That way, we have the error into a variable, so you could send that variable through an email.

     

    It's not the optimal solution, but I hope it helps!

  • Cayshin Profile Picture
    338 on at

    Thanks @PetrosF-MSFT , that's kind of what I'm asking. How do I set the error into a variable?

    I would add Set Variable action, but then what do I actually set it to? %Error%?

     

    *Edit* - Nevermind, I see what you're saying. Something like this?

    Cayshin_0-1605041296527.png

     

    This would be fine if there were only a few possible failure points. I was hoping for something I can put under the "All Errors" section as a generic catch-all method, so I only have to set one rule per action, instead of 1-4+.

    Cayshin_1-1605041389229.png

     

    Some actions, like a "Wait for Window" have multiple ways they could fail, so using the suggested method would mean creating 4x as many error rules. 

    Cayshin_2-1605041535936.png

     

     

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I was told MS programmers are currently working on Exception (Try-Catch) blocks and it should be available soon. There was function in WinAutomation to get last exception, which would get you the error message. I expect it to be implemented alongside the exception block...

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Haha, the new version was just released. It has the "On block error" functionality, which is a clumsy name for Try-Catch

    MichaelBoruta_0-1605209803200.png

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 632

#2
Haque Profile Picture

Haque 458

#3
Valantis Profile Picture

Valantis 357

Last 30 days Overall leaderboard