Power Automate: How to get more than 5000 SharePoint Items

Dominic Liu
2 min readFeb 8, 2024

--

If you are using the ‘Get Files’ action in Power Automate, you will notice that you cannot query more than 5000 items in one batch.

There are a number of ways to overcome this issue. For example, you could add the Filter Query to narrow down the search list or enable Pagination and set the Threshold so you can retrieve more items. However, both methods have quite obvious pros and cons. The Filter Query may not always apply, and enabling Pagination can significantly decrease performance, even causing timeouts.

I tried a different approach to overcome this limit. In my case, I have a Dynamics 365 environment integrated with SharePoint Online, hence I can easily retrieve the ‘Folder Name’ by searching the sharepointdocumentlocation table in Dataverse for the relativeurl field.

After that, I can call the SharePoint REST API (GetFolderByServerRelativeUrl) to retrieve the files I need, along with their respective attributes.

This method only works if you know the folder name. Depending on your system setup, you might use other methods to retrieve the folder name. Overall, finding the folder name should be relatively easier compared to overcoming the 5000 limit from the SharePoint Get Files action.

Hope this helps!

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Dominic Liu
Dominic Liu

Written by Dominic Liu

Power Pages Developer | Dynamics 365 Developer

No responses yet

Write a response