How To Set An Email Category In Power Automate

How To Set An Email Category In Power Automate

Power Automate can be used to set an email category. A category is an feature that allows you to tag, label and group messages. Emails also become easier to spot because a badge is displayed with the category name. There is no dedicated action for setting a category but it’s possible to do with the Outlook Send An HTTP action – which by the way does not require any premium licensing.

Table of Contents
• Introduction: The "Top Customer" Sales Email AutomationUpdate An Email Category Name In OutlookConfigure The "When A New Email Arrives" Trigger SettingsSet An Email Category Using The Microsoft Graph APIRun The Flow To Set The Email Category




Introduction: The “Top Customer” Sales Email Automation

Salespeople at a manufacturing company talk with their customers over email. When a new email is received from a “top customer” Power Automate applies a category to the email to make it easier for the salesperson to identify.



For example, “Top Customer” appears as badge for this new email from [email protected].




Update An Email Category Name In Outlook

Email categories are maintained in Outlook 365. There are several color coded preset categories by default. We want to update an existing category to read “Top Customer” instead.

Go to Outlook.com and right-click on any email in the inbox. Choose Categorize. Then select Manage Categories.



Change the name of one of the existing categories to “Top Customer” and close the menu.




Configure The “When A New Email Arrives” Trigger Settings

Open Power Automate and create a new automated flow using the Office 365 Outlook – When A New Email Arrives (V3) trigger. Choose the Folder named Inbox. Select an an account that can send an email to the inbox in the From field. This account will serve as a “Top Customer.”



Go to the trigger’s Settings and enable Split On. This tells Power Automate to evaluate each email individually as it arrives in the inbox.




Set An Email Category Using The Microsoft Graph API

We must use the Microsoft Graph API to set an email’s category since it does not appear as a standard action in Power Automate. Add an Office 365 Outlook – Send An HTTP Request action to the flow and select the PATCH method.



Use the following URI to update the message object.

https://graph.microsoft.com/v1.0/me/mailFolders/Inbox/messages/@{triggerOutputs()?['body/id']}



Supply this JSON to the Body of the action.


{
"categories": ["Top Customer"]
}



Write this code in the Content-Type field.

application/json




Run The Flow To Set The Email Category

Now that our very simple flow is completed let’s try it out. Save the Power Automate flow in the editor and start a manual test. Then send a new email to the target inbox using the account we chose in the trigger’s From field.



The flow will completes successfully.



And a “Top Customer” badge shows within the email to display its’ category.






Questions?

If you have any questions or feedback about How To Set An Email Category In Power Automate please leave a message in the comments section below. You can post using your email address and are not required to create an account to join the discussion.

Matthew Devaney

Subscribe
Notify of
guest

6 Comments
Oldest
Newest
Inline Feedbacks
View all comments
Diego
Diego
2 months ago

Thank you for your great articles Matthew.

Have you found a way to read the categories from an email?

Damian Green
Damian Green
1 month ago

Is there a way to have Power Automate create a category when emails are sent out and then put it on those messages?

Jay
Jay
1 month ago

By chance, is there anyway to apply colour coding within the flow for the category badge? – so that if multiple categories are assigned, certain categories are different colours.

raoul
raoul
29 days ago

Excellent – and now the other way around 🙂 When I manually set a label on an email, I want a flow to ask me to enter a date, set a reminder and set a follow up flag, so it appears in my todo.

I wonder how the trigger “when a label soandso, then..” is set.