How do I overcome the 5000 threshold Of SPO lists

Copper Contributor

I have many libraries with way more than 5000 files. 

I am Building an SPFx web part and one of the action is to find documents in these libraries.


Using SP REST even when using top(10) I get the error:"The attempted operation is prohibited because it exceeds the list view threshold."


I tested the equivalent in Graph explorer but it returns:"The request is unprocessable because it uses too many resources"


So there is no way to programaticly find documents in libraries with over 5000 files?

Any one has a good advice. 




4 Replies
I don't think lists were created for this purpose. It sounds like you need to create a database if you need to programmatically query for information with > 5000 rows. Apparently if you add an index then you can query for up to 20,000 items.

@Joe Stocker My problems are not with pure lists they work fine with more than 10,000 items so far.

The big problem is with files in libraries some of which will have more than 5000 files and then I can't add more files or publish major version with JavaScript methods.

I contact MS support and they have no solution but to structure libraries with folders of less than 5000 which is a big development challenge that adds nothing to the business needs.


One out of the box idea is to use a Microsoft Flow to take the list data and post it to a database that you can then programmatically query
Again, the problem is not in Lists that can be replaced by Database, the issue is with libraries with files, not a suitable candidate for Database