MailFolders
Lists all mail folders within user mailboxes, such as Inbox, Sent Items, and custom folders. It enables folder-level message organization and navigation in Exchange.
Table Specific Information
Select
Get the mail folder collection directly under the root folder of the signed-in user. The returned collection includes any mail search folders directly under the root:
SELECT * FROM MailFolders SELECT * FROM MailFolders where userId ='1c67f23f-8681-4c67-9c19-253e628442d5'
Note: This operation does not return all mail folders in a mailbox, only the child folders of the root folder. To return all mail folders in a mailbox, each child folder must be traversed separately.
SELECT * FROM CData.MSGraph.MailFolders Where userId ='1c67f23f-8681-4c67-9c19-253e628442d5' and id = 'AQMkAGY1YTc5NjE4LWE4MWYtNDI3Yy1iYgBmYi1hNDk0ZmMxZTJjZDgALgAAAz6irHRWjXlFqioVZIpcig4BAG0Pxgnb-IlHsx0QnxhOmzcAAAIBGAAAAA==' SELECT * FROM CData.MSGraph.MailFolders Where userId ='1c67f23f-8681-4c67-9c19-253e628442d5' and id = (SELECT parentFolderId from CData.MSGraph.MailFolders where userId ='1c67f23f-8681-4c67-9c19-253e628442d5' and displayName = 'Inbox')
Columns
| Name | Type | ReadOnly | Description |
| id [KEY] | String | False |
Unique identifier for the mail folder, used to retrieve or reference the folder within the user's mailbox hierarchy. |
| childFolderCount | Int | False |
Total number of child folders contained within this folder. Helps determine folder structure depth and sub-organization. |
| displayName | String | False |
The display name of the mail folder as shown in the user interface, such as 'Inbox', 'Drafts', or custom folder names. |
| parentFolderId | String | False |
Identifier of the parent folder. Used to establish the folder hierarchy and trace nesting relationships among mail folders. |
| totalItemCount | Int | False |
The total number of mail items—both read and unread—contained in the folder, including messages, calendar items, or other supported types. |
| unreadItemCount | Int | False |
The number of unread items in the folder, typically used to indicate pending or new messages. |
Pseudo-Columns
Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source.
| Name | Type | Description |
| userId | String |
Represents the user who owns the mailbox containing the folder. This is used to scope the folder data to a specific Exchange user. |