
Replace the Get emails (V3) action with HTTP requests to Microsoft Graph API:
https://graph.microsoft.com/v1.0/users/{shared-mailbox-email}/mailFolders/{folder-id}/messages
To get folder IDs dynamically:
https://graph.microsoft.com/v1.0/users/{shared-mailbox-email}/mailFolders?$filter=displayName eq '@{variables('FolderName')}'
Similar to Graph API but using Outlook REST endpoints:
https://outlook.office.com/api/v2.0/users/{shared-mailbox}/folders/{folder-path}/messages
Use the Run PowerShell Script action (if available in your environment):
$folders = @("Folder1/SubFolder1", "Folder2/SubFolder2")
$results = @()
foreach ($folder in $folders) {
$emails = Get-MailboxFolderStatistics -Identity "shared@company.com" -FolderScope $folder
$results += $emails
}
return $results | ConvertTo-Json
Create separate Get emails (V3) actions for each folder: