1

I'm building a Power Automate flow that should trigger when a new email arrives in any folder (not just the inbox). I want the flow to automatically add a category (like "BOARD") to the email once it arrives.

My question is, how can I build a Power Automate flow that adds a category to emails in all folders, not just the inbox? I'm using the 'When a new email arrives' trigger, but it only works for the inbox. How can I make it detect emails in all folders and successfully apply a category like 'BOARD'?

Here's what I'm trying to do:

  1. Trigger the flow when a new email arrives in any folder.
  2. Retrieve a list of all mail folders (since emails can be routed to subfolders).
  3. Identify the folder the email is in.
  4. Update the email by adding the "BOARD" category (or another category).

My current approach:

  1. Trigger: I'm using the "When a new email arrives" trigger, and I set it to the Inbox for now, but I want to make it flexible enough to check all folders.
  2. Retrieve all folders: I’m calling https://graph.microsoft.com/v1.0/me/mailFolders to fetch all mail folders via an HTTP request.
  3. Identify the folder: After the trigger, I’m trying to find out which folder the email came from and get the email’s details.
  4. Update the email: I’m sending a PATCH request to Microsoft Graph API to add the "BOARD" category to the email.

Here’s the PATCH request I’m using:

PATCH https://graph.microsoft.com/v1.0/me/messages/{message-id}
Content-Type: application/json
Authorization: Bearer {token}
Body:
{
  "categories": ["BOARD"]
}

0 Answers0