Skip to content

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.

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.

ParameterTypeDefaultDescription
idstring—Message ID.
destinationstring—Destination folder: well-known name (inbox, archive, deleteditems, junkemail…) or folder ID.
ParameterTypeDefaultDescription
sessionZoanOutlookMailSession—Outlook 365 — Connect session (inherited inside body).

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.

MessageCause 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 ErrorItemNotFoundNo email exists with that ID (already moved or deleted), or the destination folder does not exist.
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"