List messages
BetaReads data
Lists the messages in a Microsoft 365 mailbox or one of its folders.
Settings
| Setting | What it is |
|---|---|
| ConnectionRequired | The Microsoft Graph connection the step signs in with. |
| MailboxRequired | The mailbox this node works in — a user's sign-in address, or their object id. Your app needs Mail.Read for it. |
| Folder | A folder id, or a well-known name such as inbox. Leave empty for every folder. |
| Fields | Comma-separated property names. Add body for the whole text of each message. |
| Filter | An OData filter. With Sort by, the sorted properties come first here, in the same order — Graph's own rule. |
| Search | Words to find, in double quotes. Graph cannot combine it with Filter or Sort by. |
| Sort by | text |
| Body format | "" or "text" or "html" |
| Messages per call | 1 to 1000. Large pages of whole messages can time out — narrow Fields first. |
| Fetch every page | Follows Graph's own next-page link; refuses rather than truncating at Stop after. |
| Stop after | Pages — at most 50. |
| Cursor | Paste a previous run's Next cursor to read the page after it. |
Technical details
| Key | Value |
|---|---|
connection | texta connection id from `requires.connections` (provider `microsoft-graph`) |
mailbox | text |
folder | text |
select | text, by default "id,subject,from,receivedDateTime,isRead,hasAttachments,bodyPreview" |
filter | text |
search | text |
orderBy | text |
bodyFormat | "" or "text" or "html" |
top | number, by default 100 |
returnAll | true/false, by default false |
maxPages | number, by default 10 |
cursor | text |
Output
| Field | Type |
|---|---|
messages | array |
countMessages in this answer | number |
hasMoreMore messages are waiting behind this page | boolean |
nextCursorCursor for the next page | string |
Sample output, and the expression for each field
- count0
- hasMorefalse
- messages[]
- nextCursor""
Errors
When a step of this node stops a run, the run page shows a code. Look it up:
Example step
The step as a flow file holds it. Replace each value in <…>.
{
"config": {
"bodyFormat": "",
"connection": "<connection id>",
"cursor": "",
"filter": "",
"folder": "",
"mailbox": "<mailbox>",
"maxPages": 10,
"orderBy": "",
"returnAll": false,
"search": "",
"select": "id,subject,from,receivedDateTime,isRead,hasAttachments,bodyPreview",
"top": 100
},
"label": "List messages",
"type": "graph.listMessages",
"version": 1
}