There are many times I have used the try catch block in a flow in the past but still this topic holds something new for me to learn.. Thanks Reza for updating all these scenarios in such a beautiful manner. Keep it up, you are doing an incredible job.
So I had this situation today. My flow failed trying to send a simple email. Something was going on with our power platform today. From what I can tell there is no way to catch an error with an email notification if notifications are the cause of the failure. PS: GREAT VIDEO!
@@RezaDorrani I was trying to send myself a notification. That was the test and the platform died a millisecond after the flow started. 😂 Apparently they only had problems with Flow3 and Flow2. Something about 503 errors.
Pretty much same as the previous error handling from another video from you. But this time it is very clever to add a termination with 'Fali' in the end so the status remains as it should be. Geniues Reza!
Following are the new aspects I showcased: - Handling errors in apply to each - Terminate - Handling both failures and time outs - Error Handling template - Flow run link URL has been updated. It would also work with flows within solutions
Thank you. I was on the right track with the Scope thing, but I was sticking it in a parallel within the apply to each loop so my flow was still failing. Basically, I know that my flow was going to fail on several and I didn't really care to know that it failed, so I just wanted the ones that failed to drop off and be ignored without failing the flow. I just added a scope that ran after apply to each failed and then terminated with a successful message. I know this isn't ideal, but I am dealing with a condition that isn't evaluting correctly which is supposed to drop the items that are failing anyway. Until I get that bit figured out, this is a good band aide to allow the flow to run as "normal".
@@oualidtube thanks for the suggestion. My rule for making videos is set - “I make videos when I receive multiple requests on a topic. Every 6 months I ask subscribers for topic suggestions on Community Tab of my channel. Most voted idea gets added to my backlog. Make sure to post this idea whenever I post the next topic suggestion post.”
Hey Reza, this some great work you are doing. I am playing with the try catch scope. I have nested conditions and if a nested condition fails, the error message reflects the top parent, not the nested action. How do I get the nested action error message?
Hi Reza, very informative video and clear instructions on handling errors. Unfortunately, one of my mailbox handling flows failed with a connection error, which rendered the options to send email or Teams message , or to add an entry to a SharePoint table all inoperable. What would you recommend for connection issue error trapping?
Thank you for this solution! As usual, explained clearly and professionally. I do have a question though: I am creating (or updating) an item in SharePoint Online via my flow. Occasionally it fails due to one of the item properties being incorrect (such as the user in a People field not being found). Is there a way to catch the error and return which propety exactly was the point of failure? (I'd like to report the property and possibly try updating again in the catch block with that property excluded.)
Error handling in loops is possible. Best option would be to add another try catch block within the loop. I do not have a specific video reference on this scenario though
@@RezaDorrani Ah, ok, so the SharePoint "Update Item" and "Create Item" actions in Flow function as loops? I notice that the error message is blank when I use the actions()?['error']?['message'] (or one of the variants), but the raw output shows the error message as being directly under ['outputs']?['body']?['message']. Is this because the SharePoint actions are http requests in the background?
I do not remember the specifics. I would recommend posting your query on forums at powerusers.microsoft.com/ in case someone has done something similar.
Hi Reza, great video, I finally got around to creating my own Error Handling Template for my department to use. One question, in the last segment, where you handle the Apply to each and the array created from an error in the Create item action. How can I incorporate that functionality into the previous segment's Try/Catch solution? Does every Apply to each scenario need its own check?
Thanks Reza! Great as always sir. I have a quick question. Is there a way to throw an error message to the user in power apps if a flow doesn't run? I'm just thinking of a flow doesn't run then the user could just be sitting there waiting and not knowing there's an error and the error has been reported to the developer. Appreciate any help you can give on this idea!
Hi Reza, I have a question I hope is an I have the action "Add user to group" (the Azure AD one) When I try to create the expression actions('Add user to group') I'm getting error: Correct to include a valid reference to 'Add user to group' for the input parameter(s) of action 'Send_an_email_(V2)'. Is there something wrong with the syntax because my action has spaces in the name (I notice yours just has a single word)? If so how do you handle those?
Hey thank you for the video, it helps me a lot!!! But i have one question. I do the same exact thing, but in my Try-block i have the action "Run a flow built with Power Automate for desktop 2". And when i add in the Filter Array the expression "result('Run_a_flow_built_with_Power_Automate_for_desktop_2')" it gives me an it gives me an error message . I don't know why.
Thanks a lot - as always. 😂👍🏻😎 Maybe I have missed it, but could you do also a video about error handling when using a cloud flow triggered by Power Apps?
Thanks Max. When I do a video on power app error handling, I would include that scenario. I have nothing in my backlog around this since very few have requested this topic.
Is it possible to restart a flow at the point where there was a failure? In my case people had signed a document but afterwards there was a failure when updating the sharepoint data. I corrected the failure and want to start again with the update of sharepoint ...
Excelent video and easy to understand the explanations. Quick question though, we know that the "Result" expression only gets the top level actions. Do you know any ways to get the error details from the succeeding levels or from the actions like (If Statement, Switch or within a nested Scope)?
Great video! Only change I made was change action('Action_Name)?['error']?['message'] to outputs(Action_Name')?['body']?['error']?['message']. Any reason why you used action() instead of output()? Action() returned null error for me
Thank you so much for this video. I have a quick question. I would like to get the error from a Parse JSON action. The flow is throwing the error, "Correct to include a valid reference to 'Parse JSON' for the input parameter(s) of action' when using the expression: actions('Parse JSON')?['error']?['message'].
I have not tried this with Parse JSON hence not sure. I will recommend checking on the forums at powerusers.microsoft.com/ in case someone has done something similar.
Awesome Video Thanks Reza!. Do you recommend retry policy for any specific error types. Also i believe result function goes only one level deep. Thank you
Video shows a pattern apart from result function for loop scenarios. Retry policy default is 4 exponential retires which is good but there could be scenarios where you would want to set a fixed interval and have more tries like when calling an API.
When flow runs, check output of result(‘try’) You will get information about all actions in try and if any action was skipped, you will get its code/value. I don’t remember on top of my head.
@@RezaDorrani Sorry, my question might not be clear. If I want to include "Is skipped", what should I replace 'XXXXXX' with? @or(equals(item()?['Status'], 'Failed'),equals(item()?['Status'], 'TimedOut'),equals(item()?['Status'], 'XXXXXX') )
Hi Reza, this tutorial was very helpful in making any Flow more robust. I'd like to know if a Flow is triggered from Power Apps, how can I import your template to start using it? For my Flow through the App, I recreated the steps you outlined but doing that each time isn't viable, so I was wondering how to go about using the template through Power Apps?
Thank you for this great video! Sorry if I've missed this (Ive watched the whole video) but how do you handle errors if you have an Apply to Each loop but there are a lot of actions inside (multiple conditions/actions etc). How can I handle this?
You are great as always.😊 Any videos that you have done or you have with you or you are planning to do in improving the performance of a Canvas app with respect to patch, data retrieval and other operations for very large data sets.
Lets say I have an excel with a 300 fields. Lets also say that I have a lot of expressions manipulating the data before creating new items in SP list. An expression fails for one of the records in excel. Is there a way to know exaclty which field the error is in. It seems like It can only tell me which expression failed but does not tell me on which field the expression failed. With thousands of fields, it would be imposible to pin point where the error took place. Does this make sense?
Makes sense. We are limited to the error message which we are provided in flow. The loop pattern shown in video, will at-least hep provide details of which item failed and which expression which would help to some extent.
@@RezaDorrani Okay thank you! I have been trying to impliment something for a while and just wanted to get your opinion. I have a customer with large excel files that fail often and its hard to pin point errors. Maybe this will be something addressed in the future.
@@thechristianinitiative1445 In the video, I show an example of data being loaded from excel to SharePoint and how to notify errors for loop scenarios, but we are limited to what error messages are provided.
I loved your video. I have implemented the flow with this solution, and I am getting an error saying "Item not found" however the table is showing and empty message. The Filter Output shows "error": { "message": "Item not found"}. However, the on the Table, under message or error, it is empty. If I force an error div(1,0) the message shows on the table.
Hi Reza, thanks a lot for your video as always! May I know how to do the error handling if I have many steps in Apply to each? How can I catch the error message for each step? Thanks in advance.
The link generation for the workflow run does not work if the flow is shared with other accounts. Then the link has to include a "shared" in its url. Is there a way to find out if a workflow is shared or not during runtime?
Hello, I am trying to make an automatically reminder email generated through power automate. But I am constantly receiving this particular error. The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@triggerBody()?['entity']?['Power BI values']' is of type 'Null'. The result must be a valid array. Can you kindly guide me in this.
I have not experienced the mentioned issue and hence not sure what the cause for it could be. I will recommend posting your issue on forums in case someone has experienced something similar powerusers.microsoft.com
Hi! Is there a way to capture also the errors inside conditions? I'd implemented this solution and its fantastic but seems it doesn't work when an action inside a condition fails. I mean, it sends the information but its not very helpfull, like "An action failed. No dependent actions succeeded.". Thanks in advance!
How do you handle error in specific item in apply to each? Item 1 - has error in send email but the variables already have the values, and then it proceeds next step and then the value from item 1 has been carried over in item 2
Can I use this flow for logic apps as well because I have a similar flow as the third approach since, I have a foreach I had to go with the append to array approach, but it seems to error out saying inputs in action are not defined in the template?
@@RezaDorrani thanks for the in detail video content it worked for my logic app situation, there was not a single video on youtube that showed how to use scopes with a loop inside it except yours.
Hello Reza, thanks for sharing. Will it be possible to get the remaining flow duration before it gets cancelled? Example: we are all aware of 30 days flow running limitations. Assuming that, you are sending daily reminders to the approvals it would be great to show that the flow will be canceled after X days, please take your decision". Any idea how we would achieve it?
Video does not show approvals :) I am not aware of a way to track number of days left for a flow. You would probably need another flow to keep a track of it.
Hi, first, thank you for all your great videos. Regarding this video, depending on the error, I am finding that the error message is in different levels. So far I have found the error message at these levels. item()?['error']?['message'] item()?['outputs']?['error']?['message'] item()?['outputs']?['body']?['error']?['message'] I put 3 error messages in my table. Am I wrong? Is there a way get the message more generically?
Thats right. It depends upon the actions utilized. Also depends on wether its running a loop scenario. No way to generalize. You could read from all 3 and run a coalesce to grab the one that returns the result.
When an error occurs, you would want to stop the flow there and not move ahead. There could be certain scenarios which would be more complex, like errors in a loop.
Excellent Video - sorry for this question but how do i import the linked template in Github into My Flows ? I tried to download the zip and then import as a Solution, and I tried the Legacy import, but both failed for me. Thanks for your help
Import zip as flow (legacy) not solutions. Many have imported this without issues. I recommend posting your issue with screenshots on the forums at powerusers.microsoft.com
@@RezaDorrani Is there any other way as we have multi level approval flow and it might fail at any step and the user still sees the status as "Pending Approval" even though the flow is failed. Appreciate your help!
Good evening Reza, This video was great. One issue I came across and not sure if this is an admin issue. But the link to the workflow gave me an authorization error message. "Error: Authentication failed." Do you know why this may happen? I used the same try-and-catch components.
Yesterday I got an error on a flow sending info from a form to a SharePoint list, a column was originally set to 50 character text, I updated this over a month ago, it still seemed to fail with 65 characters saying column was set to 50 characters, I checked SharePoint, nope it was still 100. I ended up creating another column and copying over the data from the first. But is there a way to refresh it so it gets the new column settings once changed?
I make videos when I get multiple requests on a particular topic. Every quarter I ask subscribers for topic suggestions on the Community Tab of my RU-vid channel. Subscribers vote for topics and the highest voted topics get added to my backlog. Make sure you post this in the next topic suggestion post. If it gets a lot of votes, I will add it to my backlog.
I have not come across the mentioned issue and hence not sure what the fix for your issue is. I recommend posting your issue with screenshots on the forums at powerusers.microsoft.com
I have not come across this issue and hence not sure what is the cause for your issue. I recommend posting your issue/query with screenshots on the forums at powerusers.microsoft.com
I only got an email notification when the flow complete run after 3hrs. Is there any way to get the error notification while the flow is running rather than waiting till the end of the flow?
@@RezaDorrani yes when the flow failed, it sent email notification immediately. But the flow runs for over 4hrs and then it failed the flow stops and send the notification immediately. Is there any way to improve the performance of this flow to migrate data in lesser time? I am migrating over 20k data from SQL to Dataverse.
@@dynamics365series2 Im not sure what needs to be done without looking at the flow or use case. I recommend posting your issue with screenshots on the forums at powerusers.microsoft.com
Hi Raza great video. However, need your kind expertise here. I followed your steps and in the Scope (Try) I have a set stored procedure actions to be executed from a sql server. my first action timedout (Status: GatewayTimeout) and my timing on the Try block is already 10m .However, the catch block doesn't seems to be working? so as you know the Gateway timeout is only 120 second and this particular action is currently on 12 mins and keep trying. Could you please help? looking forward to hearing back from you
ok I found that if I change the Retry Policy to None from each action setting that will solve it! Now I'm trying to build the part where I rollback the executed Stored procedure incase of Timeout or failed. As my Try block involve a sequence of stored procedure and the rule is if any of these failed then I need to rollback all. any thoughts or logic how to do that controlled?
Not sure what options one has for this. I recommend checking or posting your query on forums in case someone has done something similar powerusers.microsoft.com
That would be covered when I do a video on Power Apps error handling. Idea would be to catch error as show in this video and send a response back to power apps.
Not sure. There must be something else thats failing or a parallel branch thats not completing. I recommend posting your issue with screenshots on the forums at powerusers.microsoft.com
@@CSEKAVIYAJ I don’t exactly remember but there is some concept to it. Il recommend checking on forums as I did see some posts on this powerusers.microsoft.com