Office365 List Mail Folders is used to list email folders (Inbox, Sent Items, Drafts, Deleted Items, etc.) in an Office365 account. This action can display all folders to the user, and emails in the selected folder can be viewed with another action.
Technical Specifications
Folder Listing: Returns all email folders that the user has access to. The returned data type is Office365MailFolderResult (One).
Parameters:
settings (Object – required): Office365 connection settings. The Office365 integration defined via Config Manager must be selected.
includeHiddenMessages (Boolean – optional): Used to include hidden or system messages in the results. Takes true or false values.
search (String – optional): Allows searching for folders by a specific word. (e.g., typing “Archive” will return only the archive folder).
filter (String – optional): Used to filter folders according to specific conditions.
Office365 List Mail Folders Application Steps
1. Adding an Action in UI Design
Add a Select Box that will show the user their email folders.
To provide data to this component, select + ADD ACTION → Office365 → Office365 List Mail Folders.
2. Defining Parameters
settings: Select the Office365 connection you defined in Configuration Manager.
includeHiddenMessages: If you select true, system/hidden folders will also be listed.
search: If desired, a folder name search can be performed. (e.g., “Sent”)
filter: Results can be narrowed down according to specific criteria.
3. Using the Returned Data
The returned result is of type Office365MailFolderResult and typically contains:
id: Folder ID
displayName: Folder name (e.g., “Inbox”, “Drafts”)
childFolderCount: Number of subfolders
totalItemCount: Total number of emails inside
unreadItemCount: Number of unread emails
This data can be listed in the UI to offer the user the option to “Select Folder”.
Usage Scenario: Listing Mail Folders
We want to show the user all email folders within an application.
Steps:
When the user logs into the application, the Office365 List Mail Folders action is triggered.
The returned folders are displayed in a Select Box.
When the user selects a folder → the ID information of the selected folder is sent as a parameter to the Office365 List Mails action.
This lists the emails belonging to that folder.
Office365 List Mail Folder Advanced Customizations
Inbox → Get Mails Combination: Emails can be listed automatically when the user selects the Inbox folder.
Filtering: Only specific folders (e.g., “Inbox,” “Sent”) can be displayed to the user.
Displaying Unread Count: The unreadItemCount information returned can be used to display the number of unread emails next to each folder.
Technical Risks and Controls
settings must be configured correctly. Incorrect configuration will result in a connection error.
User permissions: The user can only see folders they have access to.
Hidden messages: When includeHiddenMessages = true is used, system folders may also be returned, in which case filtering may be required in the UI.