Outlook 365 — Move
Outlook 365 — Move
Section titled “Outlook 365 — Move”Type: outlook365-move · Package: Outlook 365 v1.0.4 · Output: Dictionary<string,object>
Moves an email to another folder in the mailbox. It is the usual step to archive processed emails and take them out of the inbox, so the next run doesn’t find them again.
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.
The destination folder is given by well-known name (inbox, archive, deleteditems, junkemail, drafts, sentitems) or by ID; your own folders are given by ID. The folder must exist: the activity does not create it.
Required parameters
Section titled “Required parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
id | string | — | Message ID. |
destination | string | — | Destination folder: well-known name (inbox, archive, deleteditems, junkemail…) or folder ID. |
Optional parameters
Section titled “Optional parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
session | ZoanOutlookMailSession | — | Outlook 365 — Connect session (inherited inside body). |
Output
Section titled “Output”Returns a Dictionary<string,object> with the moved email, with the same keys as each item of Get emails (id, subject, from, fromName, to, cc, receivedDateTime, preview, isRead, hasAttachments, categories, webLink); body and bodyType are null. The key that matters most is id: the email’s new ID.
Common errors
Section titled “Common errors”| Message | Cause and fix |
|---|---|
'id' is required. | id is empty or the expression returned null. |
'destination' is required. | destination is empty or the expression returned null. |
Graph error ErrorItemNotFound | No email exists with that ID (already moved or deleted), or the destination folder does not exist. |
Example
Section titled “Example”Outlook 365 — Connect credential = credential("m365-support") └─ body: Outlook 365 — Get emails folder = "inbox" subject = "Order" → output: orders For each email in orders └─ Outlook 365 — Move id = email["id"] destination = "archive" → output: moved Outlook 365 — Set categories id = moved["id"] categories = "Processed"Related activities
Section titled “Related activities”- Outlook 365 — Get emails — find the emails to move.
- Outlook 365 — Delete — delete instead of archiving.
- Outlook 365 — Set categories — categorize the email.
- All Outlook 365 activities