Announcements
Is there a way to throw a new exception in power automate desktop ex.
If True then
dowork
else
throw Exception
EndIf
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
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:
Unless you want to manually manage errors:
i think i was shared solutions plz try nd let me know
@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
A simple way is to do something silly in the else, like convert text to number but supply 'XYZ' as the text to convert.
If true
Action
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
Hi,
You can throw a man made exception by using 'Run .Net Script' action:
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.
Congratulations to our 2026 Super Users!
Congratulations to our 2025 community superstars!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Haque 605
Valantis 340
11manish 284