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 / Business rule exceptio...
Power Automate
Unanswered

Business rule exception in power Automate Desktop

(0) ShareShare
ReportReport
Posted on by 8

Hi 

 

can anyone help me how do i throw a business rule exception in power Automate desktop?

my requirement is when the business rule condition is met i want throw exception as business exception.

I have the same question (0)
  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at

    Hi @up_1 

     

    There is no option to throw a business rule exception in power automate desktop right now, But to simulate the same you can use the BRE error details in variable (and its type if possible) and based on that you can exit the subflow or you can go to label using go to action which you see under Flow Control in Power automate desktop

    Nived_Nambiar_0-1709058585145.png

     

    Hope this information helps !

    Thanks & Regards,

    Nived N 🚀

    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel

    🔍 Found my answer helpful? Please consider marking it as the solution!
    Your appreciation keeps me motivated. Thank you! 🙌

  • up_1 Profile Picture
    8 on at

    i have no idea on this can u make a sample flow on this

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    What exactly do you mean by "throw exception" here? Do you want the flow to stop? If so, you can stop it via Stop flow and make it stop with an error. Then simply set a custom error message for it.

  • up_1 Profile Picture
    8 on at

    like in uipath we throw exception for new business rule exception(file not found) in the same way i want to make that particular trasnsaction as exception when the condition is met , i dont want to stop the bot . i want remaining transaction o be processed from excel

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    There is no framework for that in PAD. You need to build it yourself. Simply use a conditional action (based on whatever you're checking) and then add further actions to update your item in whatever tracking system/database you use.

  • up_1 Profile Picture
    8 on at

    can u plz make any sample flow on how we can do this. Iam a new to PAD

  • Deenuji_Loganathan_ Profile Picture
    6,250 Moderator on at

    @up_1 

     

    Let me put that in simple way:

     

    System exception refers to errors originating from the system itself, such as a web application or a standalone application. For instance, when the application is unreachable or when a UI element cannot be located.

     

    Business exception, on the other hand, pertains to exceptions caused by business logic rather than system errors. These exceptions are typically user-defined, such as the condition where an invoice processing automation, the invoice number is anticipated to be numeric. If a string is provided instead of a numeric value, it triggers an invalid data format business exception.". Let's go ahead and great sample business exception for the same.

     

    1. Creating the Business Exception variable:

      • The variable "Business_Exception" is used to store information about any exceptions encountered during the process. In this logic, it's initially set to an empty string to signify that no exceptions have occurred yet.
    2. Validation and Exception Handling:

      • Within the loop, each invoice number is validated. If an invoice number is found to be invalid or cannot be converted to a number (an error occurs during conversion), the "Business_Exception" variable is updated to indicate an "Invalid invoice number."
    3. Handling Exceptions:

      • After encountering an exception, the process checks if the "Business_Exception" variable is not empty. If it's not empty, it implies that an exception has occurred.
    4. Sending Email Notification for Exceptions:

      • If an exception occurs (i.e., an invalid invoice number), the process sends an email notification through Outlook. This email alerts the designated recipient about the issue and provides details regarding the specific record that failed due to the invalid invoice number.
    5. Resetting the Business Exception:

      • Once an exception is handled (either by sending an email notification or by the absence of an error), the "Business_Exception" variable is reset to an empty string. This ensures that the variable is clear and ready to capture any subsequent exceptions encountered during the loop iterations.


    Business Exception flow:

    Deenuji_0-1709212140189.png

    Excel File:

    Deenuji_0-1709212200645.png

    Error Email:

    Deenuji_1-1709212247707.png

    Code:
    Outlook.Launch Instance=> OutlookInstance
    Excel.LaunchExcel.LaunchAndOpenUnderExistingProcess Path: $'''C:\\Users\\Documents\\Invoice_Details.xlsx''' Visible: True ReadOnly: False Instance=> ExcelInstance
    Excel.ReadFromExcel.ReadAllCells Instance: ExcelInstance ReadAsText: False FirstLineIsHeader: True RangeValue=> ExcelData
    SET Business_Exception TO $'''%''%'''
    LOOP FOREACH CurrentItem IN ExcelData
    Text.ToNumber Text: CurrentItem[0] Number=> TextAsNumber
    ON ERROR
    SET Business_Exception TO $'''Invalid invoice number'''
    END
    IF IsNotEmpty(Business_Exception) THEN
    Outlook.SendEmailThroughOutlook.SendEmail Instance: OutlookInstance Account: $'''deenu@.test.com''' SendTo: $'''deenu@onmicrosoft.com''' Subject: $'''Invalid Invoice''' Body: $'''Processing record failed due to Invalid Invoice number : %CurrentItem[0]%.''' IsBodyHtml: False
    END
    SET Business_Exception TO $'''%''%'''
    END

     _____________________________________________________________________________________________________________________

     

    If I've resolved your query, please consider accepting it as the solution and giving it a thumbs up to help others find answers faster.

     

     

     

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 953

#2
Valantis Profile Picture

Valantis 810

#3
Haque Profile Picture

Haque 622

Last 30 days Overall leaderboard