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 / Throw a new exception ...
Power Automate
Unanswered

Throw a new exception in power automate desktop

(1) ShareShare
ReportReport
Posted on by 58

Is there a way to throw a new exception in power automate desktop ex.

If True then

      dowork

else

     throw Exception

EndIf

I have the same question (0)
  • Riyaz_riz11 Profile Picture
    4,048 Super User 2026 Season 1 on at

    Hi @mayankgoyal 

     

    U can do that, many ways u can do, set variable or create a subflow or label also u can use,for exception inside else condition.

     

    Regards

    Ahammad Riyaz

  • tkuehara Profile Picture
    667 on at

    The "On block error" action seems to be the closest one to the target approach. Any actions errors within the block will be handled by it, and you can choose to throw an exception:

    tkuehara_1-1624906461317.png

     

    Unless you want to manually manage errors:

    tkuehara_2-1624906655291.png

     

  • Riyaz_riz11 Profile Picture
    4,048 Super User 2026 Season 1 on at

    Hi @mayankgoyal 

     

    i think i was shared solutions plz try nd let me know

     

    Regards

    Ahammad Riyaz

  • mayankgoyal Profile Picture
    58 on at

    @Ahammad_Riyaz - Thanks a lot for your response. I checked the solution you mentioned but wasn't able to understand it. I am trying to find out a action with which we can throw a NEW custom Exception. Ex. - 

    If a = b then

    PASS

    Else

    Throw New Exception ("Failed")

    End If

  • Cobyc Profile Picture
    21 on at

    A simple way is to do something silly in the else, like convert text to number but supply 'XYZ' as the text to convert.

    Cobyc_0-1645616405335.png

     

  • sri24 Profile Picture
    31 on at

    throwexception.jpg

     If true

         Action

    else

       Rise error manually by dividing number/0 and catch it into a variable 'FlowError'

     

     

    Then, FlowError variable needs to be checked if empty or not -->to find the exception

     

  • imkalp Profile Picture
    10 on at

    Hi,

     

    You can throw a man made exception by using 'Run .Net Script' action:

     

    imkalp_0-1697442611984.png

     

    Thanks,

    Kalpesh

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 March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 605

#2
Valantis Profile Picture

Valantis 340

#3
11manish Profile Picture

11manish 284

Last 30 days Overall leaderboard