Email classification with AI Builder and Power Automate

We’ve all experienced it: the flood of emails in customer service. Most of the companies we support have one or more inboxes that receive hundreds of emails every day. From complaints and queries about newsletters, payment options, and deliveries to donation requests and fan mail, everything is included. Typically, these inboxes are managed manually by employees, where one person reads, analyzes, and classifies each individual email and then creates a support ticket, which is later processed by another member of the support team. In the era of powerful large language models, we believe this effort is no longer justifiable. That’s why we’ve digitalized the handling of incoming emails with AI Builder and Power Automate.

First, we used Copilot to create a short description for each existing support category and its corresponding subcategories. One of our customers had nearly 200! These descriptions enable the artificial intelligence we use in the next step to understand the categories correctly. The data, which we initially had in an Excel list, was then imported into the existing Microsoft Dynamics 365 Customer Service entity, “Subjects,” in Dataverse using a data flow. To ensure quality, support staff reviewed all AI suggestions directly in the “Subject hierarchy management” section of Microsoft Dynamics 365 Customer Service and made necessary adjustments.

All that’s missing now is a Power Automate Flow! The trigger is simple: when a new email arrives in a mailbox. Then, Power Automate determines the current month and year using two variables – typically two highly relevant parameters in the service context, as they enable us to calculate the time since purchase and more accurately assess the customer’s claim. After Power Automate retrieves the list of support categories, including the previously stored natural language descriptions, our AI Builder prompt finally comes into play.

The previously created AI Builder prompt is now started. It creates a summary of the incoming email, determines the purchase date from the text, calculates the relevant time period since purchase for warranty cases, and identifies the appropriate support category, its description, the service type, and the email address. The AI Builder Prompt returns all this information to the Power Automate Flow in the form of a JSON file.

After parsing the information, the flow searches in the ticket system – in our case, Microsoft Dynamics 365 Customer Service – for a contact with the matching email address. If a contact is already present, Power Automate creates a new service ticket for that entity. If not, Power Automate first creates a new contact and then the service ticket. The fact that the ticket is automatically categorized and assigned to the correct contact person impresses not only me but also many of my clients time and time again. The original email is also attached to the service ticket, making it available in the service department.

Of course, this setup works with any standard ticket system – from SharePoint Ticket and Jira to D365 Customer Service. And here’s the best part: AI Builder supports more than 100 languages. So it can always perform its analysis in the service team’s primary language, regardless of the language in which the incoming email was written. The original message in the D365 Field Service can then be translated into many languages with a single click using the integrated Copilot. Goodbye, language barriers!

 

 

Possible further developments of our case could include the automatic answering of specific service requests by the AI. Our clients still have reservations here, which is why they currently only use AI to draft responses. A human still carries out the actual sending. However, in my opinion, it won’t be long before we define support categories for the first clients that are handled entirely – or at least in the initial stage – automatically, without any human intervention.

About the Author

Sebastian Wilms

About the author: Why does Sebastian like the Power Platform so much? Because it takes work off your hands! Our automation enthusiast has kept pace with progress since 2000, consistently focusing on improving our customers’ working environments to make them more efficient. Sebastian only allows himself to slow down in his free time, for example, by playing board games or going on adventures with his children in the great outdoors.

Share this on...