“Is there a way to overcome the limit of 25 emails that are returned by the ‘Get emails (V3)’ Power Automate action?”
If you extract emails with the ‘Get emails’ action, you’ll notice the ‘Top’ field. This field defines how many emails it’ll retrieve, and the maximum is 25 emails. The action doesn’t allow you to define any higher number, you’ll get 25 emails and that’s it.
But that’s a small limit considering how many emails some people send and receive daily. There can be a hundred, or multiple hundreds of emails waiting for processing.
How do you get all those emails?
Get the emails directly via Graph API
While the ‘Get emails’ action is limited, there’s another way how to get emails from your mailbox – via the Microsoft Graph API. You can imagine it as the ultimate interface to communicate with the Microsoft 365 platform, and although it can get quite complicated for some operations, extracting emails is easy.
The action you’re looking for is the Office 365 Groups action ‘Send an HTTP request’.
This action allows you to send some requests to Graph API, and retrieving emails is one of them.
Get emails from top level folder
To get emails from the top level folder you can reference it by the folder name, e.g. Inbox or SentItems.
Such HTTP request will give you the emails in the folder including all their data. Which can be a bit more information than you need and it can take a while before it loads everything. Adding the $select parameter will reduce each email information only to some properties, e.g. the sender and the subject in addition to the default email id.
The last parameter to add is the number of emails. By default it’ll return 10 emails as the ‘Get emails’, but you can add the ‘top’ parameter to increase the number, e.g. to 100 emails.
Get emails from subfolders
It gets a bit more complicated with the subfolders. Unlike the top level folders you can’t reference them by their name, you’ll need their ID.
The easiest way to get the folder id is similar to getting id of a folder in a shared mailbox. Add the ‘Get emails’ action, select the folder, and go to ‘Peek code’.
You’ll see the parameter ‘folderPath’ starting with Id:: and following with the folder id.
That’s the ID you need, it might look as below:
Take it and use it instead of the folder name in the HTTP request.
Using the ID you can reference any folder on any level in your mailbox.
It’s possible to get more than 25 emails from a mailbox in Power Automate, but not with the default ‘Get emails’ action. The action has a limitation that you can’t bypass, therefore, you must use another approach. And the approach is to ask for the emails via Graph API. Use the Office 365 Groups action ‘Send an HTTP request’, define which folder it should check, and get as many email as you’d like.