How To Automatically flag negative emails in Office 365 using Microsoft Flow

Despite the ever-growing list of options to communicate and collaborate with people, email still persists. It’s like a weed that just won’t go away. In fact, it’s estimated that email will top 3 billion users by 2020. Some days, I feel like I’m on the receiving end of all the world’s email and I bet you do, too. Wouldn’t it be great if you could automatically flag the negative emails, especially the ones from your customers, so you can prioritise dealing with their issues, and keeping them satisfied? Turns out, Microsoft Flow makes this a cinch.

What is Microsoft Flow?

Microsoft Flow is a service that essentially connects things to other things, and triggers actions based on criteria. For example, I could connect my OneDrive for Business to my Outlook email and say if I get an email with an attachment, then automatically save the attachment to a folder in my OneDrive for Business. If this, then that. It’s pretty clever.

You can connect Flow to a huge number of services, and there are a few different price plans (including a free tier) to suit your needs.

Detecting negative emails

If Microsoft Flow is the glue to connect things together, then the Microsoft Cognitive Services provide the intelligence that will turn you into an email pro. In this example, we’re going to use the text analytics capabilities (specifically the “detect sentiment” feature) to detect the sentiment of incoming email. The Cognitive Services are powerful because they don’t need any code to be useful. I include them in my flow (the recipe is below), and they return a score between 0.0 and 1.0.

Emails that come back with a score closer to 1.0 would be generally positive, and ones with a score closer to 0.0 would be generally negative. I can then tell Microsoft Flow that any emails returned with a score of less than, say, 0.4 should be flagged in my inbox for me to follow up on as a priority.

The Cognitive Services, like Flow, have a free option and paid options. You’ll need to sign up for them and get an API key to plug into Flow. This is very simple and just takes a few clicks – no coding required. Head to the Cognitive Services website, under APIs, and then Text Analytics. Follow the steps to get your keys:


Once you’ve configured the Cognitive Services to get your keys, and you’ve created the recipe like the example below, you’re done! Save the Flow, sit back and relax.


Things to note

  • Since I’ve not been running this Flow for very long, I don’t know that 0.4 is the best score. I think it might be a little low, and I may edit the flow to make the number 0.5 or 0.6.





Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.