FlowmageDocs

List mail folders

BetaReads data

Lists the folders of a Microsoft 365 mailbox, or those inside one folder.

Settings

SettingWhat it is
ConnectionRequiredThe Microsoft Graph connection the step signs in with.
MailboxRequiredThe mailbox this node works in — a user's sign-in address, or their object id. Your app needs Mail.ReadBasic.All for it.
Inside folderA folder id, or a well-known name such as inbox. Leave empty for the folders at the top.
Include hidden folderstrue/false
Fieldstext
Filtertext
Folders per call1 to 999.
Fetch every pageFollows Graph's own next-page link; refuses rather than truncating at Stop after.
Stop afterPages — at most 50.
CursorPaste a previous run's Next cursor to read the page after it.
Technical details
KeyValue
connectiontexta connection id from `requires.connections` (provider `microsoft-graph`)
mailboxtext
parenttext
includeHiddentrue/false, by default false
selecttext, by default "id,displayName,parentFolderId,childFolderCount,unreadItemCount,totalItemCount"
filtertext
topnumber, by default 100
returnAlltrue/false, by default false
maxPagesnumber, by default 10
cursortext

Output

FieldType
foldersarray
countFolders in this answernumber
hasMoreMore folders are waiting behind this pageboolean
nextCursorCursor for the next pagestring
Sample output, and the expression for each field
  • count0
  • folders[]
  • hasMorefalse
  • 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": {
    "connection": "<connection id>",
    "cursor": "",
    "filter": "",
    "includeHidden": false,
    "mailbox": "<mailbox>",
    "maxPages": 10,
    "parent": "",
    "returnAll": false,
    "select": "id,displayName,parentFolderId,childFolderCount,unreadItemCount,totalItemCount",
    "top": 100
  },
  "label": "List mail folders",
  "type": "graph.listMailFolders",
  "version": 1
}