Posts

Showing posts from December, 2022

Exception handling in Power Automate

Image
Exception handling is the most common practice used in programming to tackle unwanted or unexpected events. Since exception handling deals with anomalies, it avoids program error, flow error and system crashing.  There are many reasons that can cause exceptions, including expression error, invalid user input, loss of network connection, user attempting to open files that are not available. The Try Catch mechanism is used to capture exceptions. Try defines a block of statement that may throw an exception. When a specific type of exception occurs, the catch block catches the exception. Now let us consider a usage scenario to understand Try-Catch mechanism within power automate. We can use a Power Automate flow to send an HTTP request and based on the response we need to acknowledge the receipt in the CRM. If the response to the HTTP request is ‘ true ’ we need to change a field in CRM to Success . And if the response is ‘ false ’ the field in CRM should change to Failed. There can be sce