Adventures with Power Automate: Monitor Email Inbox for Messages with No Replies with Sentiment Analysis

I was asked by a customer how they could monitor an email inbox that was used to capture their customer support requests.

They wanted to retrieve all the messages in the inbox that had not been replied to and then send an email to the support engineers making them aware of the lack of response.

Seems straight forward enough, but wait! There’s more!

They wanted to know if we could look at the body of message and determine the mood of the custome who sent the request, if the language used was frustrating, angry, hostile or negative in any way, they wanted to flag the email sent to the support engineers as High importance.

The decision? Create a Power Automate flow to handle this task!

To accomplish this task I used the following connectors in the flow:

Why did I not use the Outlook connector? There is a limitation on the number of messages that can be received, you can only retrieve the Top 25 messages. The HTTP with Azure AD connector does not seem to have these limitations, and also allowed for me to retrieve messages by conversationId.

One other thing to not, I had to convert the body of the message from HTML to Plain Text due to the size limitation of the message that can be processed for sentiment analysis, which is why I used the Content Conversion connector.

Here is what my completed flow looked like:

Figure 1 – Power Automate Flow

For the sake of this example, I have it firing once a month, in the “real” world, would be more like once or twice a day, during off hours.

Here is an example of a “grumpy” email that I sent to test my flow.

Figure 2 – “Grumpy” Email

The sentiment analysis led to a mixed result, which would send an email as High importance, which was the desired outcome.

Figure 3 – Completed Sentiment Analysis

You can download the complete solution at https://1drv.ms/u/s!Ah6xh5d0qbNokb5hSg9DPE8mFoZpqg?e=X4fcUH and see the flow in detail in your own Power Platform environment.

This article Extract sentiment from text with AI Builder | Power Automate Blog (microsoft.com) provided a lot of great insight on how to do this task.

Enjoy!


Discover more from Matt Ruma

Subscribe to get the latest posts to your email.

Leave a Reply

Your email address will not be published. Required fields are marked *