How To Get Over 25 Emails In Power Automate
The Outlook – Get Emails (V3) action in Power Automate can get a maximum of 25 emails. To get over 25 emails you can use the Outlook – Send An HTTP request action instead and call the messages endpoint. This method uses the Microsoft Graph API however it only uses standard Power Automate actions.
Table of Contents
• Introduction: The Get Emails From An Inbox Automation
• Get Emails From A Shared Inbox With MS Graph API
• Alternate: Get Emails From A Personal Inbox With MS Graph API
• Include Attachments For Emails Returned By MS Graph API
• Run The Power Automate Flow To Return A List Of Emails
• View The Completed Power Automate Flow
Introduction: The Get Emails From An Inbox Automation
An automation is used to get emails and their attachments from an inbox for further processing. The email inbox has hundreds of messages.
A Microsoft Graph API request allows the Power Automate flow to get over 25 emails in a single API call.
Get Emails From A Shared Inbox With MS Graph API
Open Power Automate and create a new flow with an instant trigger. Name the flow Get Over 25 Emails In Outlook.
Add an Office 365 Outlook – Send An HTTP Request action to the flow and select the GET method. We must use an HTTP action because the Get Emails (V3) action has a limit of 25 emails. The limit does not apply when we get emails using the MS Graph API instead.
Fill-in the URI field with with the following code. Replace [email protected] with the address of the shared inbox. The account running the flow must have access to the shared inbox. Also, notice that the URI contains oData filters to get the top 999 emails sorted from newest-to-oldest.
https://graph.microsoft.com/v1.0/users/[email protected]/messages?$top=999&$orderby=receivedDateTime desc
Alternate: Get Emails From A Personal Inbox With MS Graph API
We could also choose to use the personal inbox of the account that runs the Power Automate flow.
Change the MS Graph request URI to use the me endpoint instead of the users endpoint.
https://graph.microsoft.com/v1.0/me/messages?$top=999&$orderby=receivedDateTime desc
Include Attachments For Emails Returned By MS Graph API
The emails returned by the MS Graph API do not include any attachments. To get the attachments we must make an additional Graph API call. Add an Apply To Each action to the flow.
Then use this expression in the Select an output from previous steps field. The value property contains the list of emails.
body('Send_an_HTTP_request:_Get_Emails')?['value']
Insert a Condition action to check whether the email message has attachments. Fill-in the left-side of the condition with the hasAttachments dynamic value and check if it is equal to true.
In the If yes block, add another Office 365 Outlook – Send An HTTP request action.
Use this code to target the attachments endpoint and return a list of attachments for the specified message.
https://graph.microsoft.com/v1.0/users/[email protected]/messages/@{items('Apply_to_each:_Email')?['id']}/attachments
Run The Power Automate Flow To Return A List Of Emails
The flow is now completed. Give it a test run to ensure the flow works as planned.
We can see all of the emails returned inside of the value property of the first Send An HTTP request action.
And we can also see the attachments for an individual email message inside the the value property of the second Send An HTTP Request action.
View The Completed Power Automate Flow
Here is a screenshot of the completed Power Automate flow.
Did You Enjoy This Article? 😺
Subscribe to get new Power Apps & Power Automate articles sent to your inbox each week for FREE
Questions?
If you have any questions or feedback about How To Get Over 25 Emails In Power Automate please leave a message in the comments section below. You can post using your email address and are not required to create an account to join the discussion.
So with this the limit has gone up to 999 from 25?
Ramesh,
Yes, the maximum is 999 records per page. I suspect you can use pagination with this as well to get even more. I’ll have to check on it.
Some of our workflow emails (V3) were getting throttled. Our approach was to switch to using “Send an email from a shared mailbox (V2).” The recipient quota for V2 is 10,000 per day.
We set up a Shared Mailbox for our branch’s heavier workflows. We then configured the mailbox as a no-reply and added an auto-responder message.