Managing emails efficiently is a challenge for many organizations. Moving email content—such as sender, recipients, subject, and attachments—into a SharePoint list can unlock powerful reporting and automation. But what if you also need to capture the Outlook category?
By default, Power Automate (Microsoft Flow) doesn’t expose categories in the standard Outlook connector. Luckily, there’s a workaround: combining Power Automate with the Microsoft Graph API.
The Challenge: Capturing Outlook Categories
A common requirement is to build a Power Automate flow that pushes emails into a SharePoint list. Standard fields like subject, body, and attachments work fine with the Outlook connector. However, categories are not available as an expression.
This limitation makes it difficult to track or report on categorized emails in SharePoint—unless we extend the solution.
The Solution: Power Automate + Microsoft Graph API
The missing piece comes from the Microsoft Graph API, which provides full access to Outlook message properties, including categories. By calling the Graph API within a flow, you can retrieve the categories
property and store it alongside your email data in SharePoint.
Step-by-Step Guide
1. Create Your SharePoint List
Set up a list with columns for:
- From
- To
- Subject
- Body
- Attachments
- Category
2. Build the Flow in Power Automate
Start with a trigger such as:
- When a new email arrives
or - For a selected email
This will provide the messageId you’ll use later.
3. Extract Standard Email Data
Use the Outlook connector to capture:
- Sender
- Recipients
- Subject
- Body
- Attachments
4. Call Microsoft Graph API
Add an HTTP action to fetch categories with:
GET https://graph.microsoft.com/v1.0/me/messages/{messageId}
- Replace
{messageId}
with the dynamic value from the email trigger. - Ensure the flow has proper Graph permissions (e.g.,
Mail.Read
).
5. Parse and Store Categories
- Use Parse JSON to extract the
categories
field from the API response. - Map it to the Category column in your SharePoint list.
6. Create the SharePoint Item
Combine everything into the “Create item” action. Your email data, complete with categories, will now be logged in SharePoint.
Best Practices
- Permissions: Use Azure AD app registration for secure Graph API calls.
- Error Handling: Build retries for failed API requests.
- Performance: Be mindful of throttling on high-volume mailboxes.
- Security: Protect credentials and sensitive information.
Why This Approach Matters
Outlook categories are often used for internal workflows, prioritization, or compliance. By bringing this metadata into SharePoint, you gain richer reporting, searchable records, and more automation options.
Combining Power Automate with Microsoft Graph turns what seems like a limitation into a powerful integration pattern.