I have a flow setup that sends out a reminder to users if they have any sharepoint items due on the current day (the flow runs at 5am daily). It sends out these reminders via the Flow Bot on MS Teams chat.
It works okay, but I get a failure notice each day because one user has blocked the flow bot. That's entirely the user's choice, if they don't want to interact with the bot I'm not here to change their mind. But I would like to stop the email alerts telling me about a failure due to this situation. The actual error is:
Request to the Bot framework failed with error: '{"error":{"code":"ConversationBlockedByUser","message":"User blocked the conversation with the bot."}}'.
So, can I ignore this type of failure so I'm not seeing false-alarm notices every day?
Solved! Go to Solution.
Hey @ShawnKeeneTF
If the only action in the loop is the 'Teams post message' then could simply drop the terminate outside of the loop assuming you're not concerned about being notified of general issues.
If you need to handle the errors alittle more gracefully, you could do something similar to... but pls check the property the error is contained within from the Teams action (it might not be the body)
HTH
Jay
Hey @ShawnKeeneTF
Have you considered using the 'Run after' options to control error handling?
More details here: https://blog.encodian.com/2019/06/error-handling-in-microsoft-flow/
In the branch handling the failure you could also add a condition to handle specific errors
HTH
Jay
-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up
It looks like that would try to the message as the flow bot, then check to see if it failed. But if it had failed, wouldn't the error message already be thrown because the post-a-message had already been attempted?
The run-after configuration allows you to control flow when an action generates an error... in the example I showed you can see even though the action error-ed I can manually record the flow as successfully completing.
Have you tried this suggestion?
Jay
I ran into a snag trying to implement it. It says I can't put that control into the "apply to each" area. But it seems like it must go there, because some of those will succeed (only some fail).
Hey @ShawnKeeneTF
If the only action in the loop is the 'Teams post message' then could simply drop the terminate outside of the loop assuming you're not concerned about being notified of general issues.
If you need to handle the errors alittle more gracefully, you could do something similar to... but pls check the property the error is contained within from the Teams action (it might not be the body)
HTH
Jay
Thanks Jay, I'll try the former option first, it should be perfect for this situation. Thanks a ton.
Will the loop continue to run, though @Jay-Encodian? If the error occurs in the Apply to Each action halfway through, will the loop skip over the user(s) who blocked the bot and continue to notify others if their SharePoint item is due?
I have almost the exact same flow as you @ShawnKeeneTF and the exact same issue : ) . User A has blocked the bot. Anyone who comes before User A in the Apply to Each action gets the notification. When the action gets to User A, the flow errors out and is terminated. All users that would have come after User A do not get the notification.
Any insight would be greatly appreciated!
I didn't think it stopped the loop from running, although that was just an assumption on my part. I thought that any following users that hadn't blocked the bot would still receive their reminder.
The flow has been running, but the user who blocked the flow bot and caused the action to fail has been coming through last in each of the runs this week 😅. I'll test it by changing the sort order and get back to you. Thanks!
User | Count |
---|---|
22 | |
15 | |
14 | |
10 | |
9 |
User | Count |
---|---|
45 | |
29 | |
25 | |
24 | |
24 |