Skip to content

Outlook 365 — Set categories

Type: outlook365-set-categories  ·  Package: Outlook 365 v1.0.4  ·  Output: —

Sets an email’s categories (Outlook’s color tags). Use it to visually flag processed emails or classify them by type, so the team can see their status at a glance.

It works on the session created with Outlook 365 — Connect. Pass it in the session parameter, or place this activity inside the body of Outlook 365 — Connect to inherit it automatically.

  • It replaces the email’s categories with the ones you give. To add one without losing the rest, take the current ones from the categories key of Get emails and pass them together with the new one.
  • An empty value clears all categories.
  • Categories are given by name. If the name is not in the mailbox’s category list, Outlook assigns it anyway, without a color.
ParameterTypeDefaultDescription
idstring—Message ID.
categoriesstring | List—Category name(s): text separated by commas or semicolons, or a list. Empty clears the categories.
ParameterTypeDefaultDescription
sessionZoanOutlookMailSession—Outlook 365 — Connect session (inherited inside body).

This activity does not return a value.

MessageCause and fix
'id' is required.id is empty or the expression returned null.
Graph error ErrorItemNotFoundNo email exists with that ID (deleted or moved). If you moved it, use the id returned by Move.
Outlook 365 — Connect credential = credential("m365-support")
└─ body:
Outlook 365 — Get emails folder = "inbox" subject = "Quote" → output: emails
For each email in emails
└─ Outlook 365 — Set categories id = email["id"] categories = "Sales, Processed"