Outlook 365 — Set categories
Outlook 365 — Set categories
Section titled “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.
How it works
Section titled “How it works”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
categorieskey 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.
Required parameters
Section titled “Required parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
id | string | — | Message ID. |
categories | string | List | — | Category name(s): text separated by commas or semicolons, or a list. Empty clears the categories. |
Optional parameters
Section titled “Optional parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
session | ZoanOutlookMailSession | — | Outlook 365 — Connect session (inherited inside body). |
Output
Section titled “Output”This activity does not return a value.
Common errors
Section titled “Common errors”| Message | Cause and fix |
|---|---|
'id' is required. | id is empty or the expression returned null. |
Graph error ErrorItemNotFound | No email exists with that ID (deleted or moved). If you moved it, use the id returned by Move. |
Example
Section titled “Example”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"Related activities
Section titled “Related activities”- Outlook 365 — Get emails — find the emails and read their categories.
- Outlook 365 — Move — archive the email.
- Outlook 365 — Mark read/unread — mark as read.
- All Outlook 365 activities