{"id":110831,"date":"2017-05-24T08:33:34","date_gmt":"2017-05-24T15:33:34","guid":{"rendered":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/error-handling\/"},"modified":"2017-05-24T08:33:34","modified_gmt":"2017-05-24T15:33:34","slug":"error-handling","status":"publish","type":"power-automate","link":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/error-handling\/","title":{"rendered":"Error handling steps, counters, a new flow details experience and more"},"content":{"rendered":"
From time-to-time, things don’t work out exactly as you expected in your flow — that’s where error handling comes in. With error handling, you can define any number of steps to run after the failure of an action. This powerful new feature will ensure that you can run even your most important business processes inside of Microsoft Flow.<\/p>\n
First, you’ll have to figure out which action you want to monitor for failures. If you already have actions after that step, you can add a new step after in parallel. In this example, let’s look at adding an error handling step for the Dynamics 365 action Create a new record<\/strong>:<\/p>\n <\/p>\n You can then select what action you want.\u00a0Once you have a new step, select the “…” menu at the top-right of the action and choose the\u00a0Configure run after<\/strong>\u00a0menu item:<\/p>\n <\/p>\n This will display the new options. You can define steps that run after:<\/p>\n <\/p>\n Select any or all of these checkboxes and then select Done. Now, you will get a mobile notification whenever the flow fails to create a new record in Dynamics 365.<\/p>\n There are even some cases where error handling may even be part of the “expected” flow. For example, if you are copying records into a system and you want to have different behavior depending on if the record exists. Or, you want to look up someone in the directory, and then if the user doesn’t exist you want to use some default values. You can set this up by having an action run after the Office 365 Get user step fails and populate the default data:<\/p>\n <\/p>\n The above template<\/a> shows how this works. It reads a record from Dynamics 365 and tries to look up that user’s email in the Office 365 directory. If the user is found, then a task is created in planner with that email address. Otherwise, the task can still be created in planner, but it won’t have email information.\u00a0<\/p>\n You can initialize and increment or decrement variables inside of a flow run. This will make it possible to know how many times a certain branch of logic ran, for example.<\/p>\n To get started you’ll first need to initialize the variable:<\/p>\n <\/p>\n Currently, you can create counters that are Integers or Floats (numbers with decimals). Once you have initialized the variable you can then increment or decrement it in your flow.\u00a0Finally, you can also then reference that variable wherever you want.<\/p>\n <\/p>\n In the above flow you can see at the top the variable is initialized, it’s incremented inside a condition in a apply-to-each loop, and then at the end a notification is sent with the contents of the variable.<\/p>\n Inside of organizations, the number of flow runs you have is a quota that’s shared across all users in the company (see the Microsoft Flow Pricing page<\/a>). Now, tenant administrators can see how many flow runs have been used by members of their org in the Microsoft Flow Admin Center<\/a>.\u00a0<\/p>\n <\/p>\n Note that trial (or free) users do not count against the organization quota, but they are included for visibility if the admin wants to understand trial usage. Second, we have added a details view to help admins understand the distribution of licenses inside their org and how each of these licenses are contributing to the quota:<\/p>\n <\/p>\n The\u00a0Quota Breakdown<\/strong>\u00a0view lists the number of runs per license, the number that are purchased, and thus what your total run capacity is. Finally, you can always purchase additional Flow Runs if your company is nearing its quota at the end of the month.<\/p>\n Starting this week, when you go to your My flows list and select a flow you’ll see a new flow details page (instead of the flow designer itself):<\/p>\n <\/p>\n This new page gives you a quick glance at everything that is immediately relevant for your flow, including:<\/p>\n To edit a flow you, the the pencil icon on the My flows list, or, select Edit flow<\/strong> in the toolbar on the properties page. You can still access the flow runs page to get the full list of every time that the flow has checked its trigger or failed by selecting the\u00a0See all<\/strong>\u00a0link on the Run history tile.<\/p>\n The Request<\/strong> trigger is an easy way to have your application invoke a flow directly. The Request trigger now has the ability to define a different method, so you can use an HTTP\u00a0GET<\/strong>\u00a0or a\u00a0PUT<\/strong>\u00a0for example. In addition, you can define additional path segments that get added to the URL and then use the values the user passed in those segments in your flow.<\/p>\n <\/p>\n Finally, we have two new partner services available this week:<\/p>\n <\/p>\n","protected":false},"excerpt":{"rendered":" This week we are announcing even more features that will make it possible to build more robust business processes inside Microsoft Flow. The first the ability to create “error handling” steps. For example, if you have a workflow that copies important data into your Dynamics 365 instance, you can now get a notification immediately if that copy fails. Second, you can initialize and increment or decrement counters inside of a flow run. Third, flows now have a rich details page that shows you a summary of all the properties of your flow. Also, admins can now monitor flow run usage across an organization against the common company run quota.<\/p>\n","protected":false},"author":347,"featured_media":0,"comment_status":"open","ping_status":"open","template":"","power-automate-category":[2752],"power-automate-tag":[],"coauthors":[2913],"class_list":["post-110831","power-automate","type-power-automate","status-publish","hentry","power-automate-category-product-updates"],"yoast_head":"\n\n
Use run after to handle missing records<\/h3>\n
Increment or decrement counters<\/h2>\n
View organization quotas<\/h2>\n
Flow properties page<\/h2>\n
\n
Use different HTTP methods and add path segments for the Request trigger<\/h2>\n
Two new services<\/h2>\n
\n