In the context of Microsoft Power Automate, as part of the PL-500 Microsoft Power Automate RPA Developer certification, it’s essential to learn how to create error handling routines in both cloud and desktop flows.
Cloud and Desktop Flows
Before we delve into error handling routines, it’s important to understand what cloud and desktop flows are. As part of Microsoft Power Automate, cloud flows allow automated workflows between your applications and data across multiple services without requiring human intervention.
On the other hand, desktop flows are more focused on automating repetitive tasks performed on Windows desktops, evolving from user interface (UI) flow that facilitates robotic process automation (RPA) by recording and playing back a series of steps or tasks.
Error Handling in Cloud Flows
Cloud flow provides built-in error handling actions, such as “run after” conditions and the “configure run after” option. The “Run after” condition allows you to specify when an action should run, based on the success, failure, timeout, or if a previous action has been skipped. For example:
- Get record from Dynamics 365.
- If the record doesn’t exist, display an error notification. This is done by configuring the “Send Email” action to run after the first action has failed.
The “configure run after” option allows you to modify the conditions that control when an action should run. You could specify multiple conditions, like running after a success and a failure, or after a failure and a timeout.
Error Handling in Desktop Flows
In Desktop Flows, Microsoft Power Automate will execute the sequence of actions as they are instructed in the flow. If any step fails, the flow will stop executing the additional steps unless error handling is configured for that specific step.
Here, you have the option to use Try Catch blocks and to utilize the “Error Handler,” which is found in the “Advanced” portion of the menu. The Error Handler will capture exceptions during execution, and you can define additional steps that should be performed when an error occurs, such as capturing a screenshot, logging the error, or sending an email notification.
Examples
Building a Cloud Flow:
- On the Microsoft Power Automate dashboard, select “Create” and then “Instant cloud flow.”
- Define the flow’s trigger (“Button” for instance) and name the flow.
- Add the “Get record” action and specify the entity and record id.
- Add the “Send Email” action and configure it to run after the previous action (Get record) has failed.
Building a Desktop Flow:
- Begin from your workflow in Power Automate Desktop.
- Select the sequence of actions where you anticipate errors might occur, then choose the “Try Catch” block from the “Advanced” tab to add these actions to the block.
- In the “Catch” block, specify actions to be performed when an exception is thrown, such as sending an email, capturing the screen, or logging the error.
In conclusion, setting up error handling routines in cloud and desktop flows in Microsoft Power Automate allows for a more efficient exception handling process.
Clear and prompt notification of errors can greatly assist in issue resolution and result in higher workflow efficiency. A well-prepared candidate for the PL-500 Microsoft Power Automate RPA Developer exam should be familiar with these concepts and know how to implement them in a variety of scenarios.
Practice Test
True or False: In Power Automate, error handling routines are automatic and do not need to be manually created.
- True
- False
Answer: False
Explanation: Error handling routines in Power Automate need to be manually designed and implemented, helping in dealing with unexpected or undesired outcomes and business exceptions.
What are the main components to include while constructing an error-handling routine in Power Automate?
- A. Exception thrower
- B. Exception catcher
- C. Exception resolver
- D. All of the above
Answer: D. All of the above
Explanation: An error-handling routine in Power Automate typically consists of the process which throws the exception, a ‘catch’ block or equivalent that handles it, and a resolver which eliminates the issue.
True or False: For cloud flows in Power Automate, you can create error handling routines using try catch actions to handle business exceptions.
- True
- False
Answer: True
Explanation: For cloud flows, Power Automate allows the addition of actions to perform “try, catch, and finally” tactics similar to software development that handle business exceptions effectively.
True or False: In Power Automate, handling business exceptions can’t be achieved by re-running the flow.
- True
- False
Answer: False
Explanation: Power Automate gives room for retries that can be used to handle business exceptions by rerunning the flow to see if the error resolves itself.
True or False: Dealing with business exceptions in Power Automate is made possible by leveraging scopes and run-after conditions.
- True
- False
Answer: True
Explanation: One can manage exceptions in Power Automate using scopes and run-after conditions, allowing for fall-backs and other corrective actions.
How can Power Automate re-try an operation that has failed initially?
- A. Manual triggering
- B. By using delay actions
- C. Both of the above
- D. None of the above
Answer: C. Both of the above
Explanation: Power Automate provides options of manual triggering and delay actions that allow to re-try failed operations.
True or False: Flow failures always lead to business exceptions.
- True
- False
Answer: False
Explanation: Not all flow failures lead to business exceptions. The failure may be due to a non-business related issue, such as a system outage or a lack of resource availability.
Which of the following services provide error handling in Power Automate?
- A. Azure Logic Apps
- B. SharePoint Online
- C. Power BI
Answer: A. Azure Logic Apps
Explanation: Azure Logic Apps provides features such as Terminate and Run After which are used for error handling in Power Automate.
True or False: A Power Automate desktop flow cannot send notifications upon failure.
- True
- False
Answer: False
Explanation: Power Automate desktop flows can indeed send notifications via emails when the flow encounters an error.
True or False: Power Automate provides a mechanism to log errors and exceptions.
- True
- False
Answer: True
Explanation: Power Automate allows logging of errors and exceptions which is essential for debugging purposes and creating error-handling routines.
Exception handling routines in Power Automate help in:
- A. Finding which operation did not work as expected.
- B. Identifying steps to correct the issue.
- C. Both of the above.
- D. None of the above.
Answer: C. Both of the above.
Explanation: Exception handling routines help in identifying the failed operation and providing ways to correct the issue.
The ‘Configure run after’ setting in Power Automate is used to:
- A. Run a process again if it fails the first time.
- B. Specify conditions for what should happen after a particular action.
- C. Both of the above.
- D. None of the above.
Answer: C. Both of the above.
Explanation: ‘Configure run after’ setting in Power Automate allows the developer to specify conditions for what should happen after a specific action, including retrying a failed process.
True or False: You are unable to check the error details of a flow in Power Automate.
- True
- False
Answer: False
Explanation: The error details can be viewed in the flow’s run history in Power Automate, offering helpful information for debugging and ensuring the efficiency of the flow.
If the ‘run after’ condition is set to ‘is successful or is skipped’, the action will run in which scenario?
- a. When the previous action is successful.
- b. When the action is manually skipped.
- c. When the Run condition is met.
- d. Both a and b.
Answer: D. Both a and b.
Explanation: Setting the ‘run after’ condition to ‘is successful or is skipped’ can enable the action to run either after the successful completion of the previous action or if it’s manually skipped.
When designing error-handling routines in Power Automate, it is advisable to:
- A. Avoid complex actions.
- B. Use the error-handler whenever possible.
- C. Both of the above.
- D. None of the above.
Answer: C. Both of the above.
Explanation: It’s prudent to avoid overly complex actions that might increase the occurrence of errors and utilize the error-handler to manage exceptions effectively.
Interview Questions
What is an error handling routine in cloud or desktop flows?
An error handling routine in cloud or desktop flows refers to a protocol put in place to handle errors or exceptions that occur while the flow is running. These routines ensure that the flow can preferably recover from an error or at the very least stop gracefully, providing info about the error.
How can you handle business exceptions in cloud flows?
You can handle business exceptions in cloud flows by using actions such as “configure run after” settings, “scope”, “terminate”, and “run after” actions to control the flow’s execution based on specific conditions or errors.
What is the purpose of the “Scope” action in error handling for desktop flows?
The “Scope” action groups actions together so that they can be treated as a single unit for error handling. If an error occurs in any action within a scope, the whole scope fails and you can handle the error by running different actions or flows based on that failure.
How does “configure run after” control the flow of execution in error handling for cloud flows?
“Configure run after” settings define the conditions under which the subsequent action should run after a preceding action. These conditions include “has failed”, “is successful”, “has skipped”, and “is timed out”, allowing developers to handle different outcomes from the previous action.
What is the purpose of the “Terminate” action in error handling for cloud flows?
The “Terminate” action stops the flow immediately when it’s executed. It’s often used in error handling to stop a flow when a critical error is encountered that the flow can’t recover from.
What are some best practices for creating error handling routines in desktop flows?
Some best practices include: Use “Try Catch Finally” blocks for sections of the flow which might throw exceptions; Log exceptions in a centralized location such as an Azure Log Analytics Workspace so that they can be monitored and analyzed; and Handle exceptions in a way that does not reveal sensitive information or underlying system details.
In the context of error handling in desktop flows, what are business exceptions?
Business exceptions refer to problems related to business rules and conditions, such as when a required file does not exist or a process can’t be completed because a customer record is missing. They differ from system or technical exceptions, which involve failures in the system or application like a network outage or database error.
How can you handle business exceptions in desktop flows?
You can handle business exceptions in desktop flows using the “sockets and exceptions” feature. By defining exception cases with rules, you can manage how your flow responds to specific error situations.
How does the “run after” feature support error handling in cloud flows?
The “run after” configuration in cloud flows enables specific actions to run based on the success, failure, or skipping of a previous action. This provides dynamic control over the flow execution in response to errors.
How can you use the “Catch” block in error handling routines for desktop flows?
The “Catch” block in error handling routines for desktop flows is designed to catch and handle exceptions. If an exception occurs in the “Try” block, the flow immediately jumps to the “Catch” block, allowing recovery actions or logging to be performed.