How do I overcome the 5000 threshold Of SPO lists

%3CLINGO-SUB%20id%3D%22lingo-sub-2409063%22%20slang%3D%22en-US%22%3EHow%20do%20I%20overcome%20the%205000%20threshold%20Of%20SPO%20lists%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2409063%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20many%20libraries%20with%20way%20more%20than%205000%20files.%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20Building%20an%20SPFx%20web%20part%20and%20one%20of%20the%20action%20is%20to%20find%20documents%20in%20these%20libraries.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EUsing%20SP%20REST%20even%20when%20using%20top(10)%20I%20get%20the%20error%3A%22The%20attempted%20operation%20is%20prohibited%20because%20it%20exceeds%20the%20list%20view%20threshold.%22%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20tested%20the%20equivalent%20in%20Graph%20explorer%20but%20it%20returns%3A%22The%20request%20is%20unprocessable%20because%20it%20uses%20too%20many%20resources%22%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%20there%20is%20no%20way%20to%20programaticly%20find%20documents%20in%20libraries%20with%20over%205000%20files%3F%3C%2FP%3E%3CP%3EAny%20one%20has%20a%20good%20advice.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2409063%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EDevelopment%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2465251%22%20slang%3D%22en-US%22%3ERe%3A%20How%20do%20I%20overcome%20the%205000%20threshold%20Of%20SPO%20lists%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2465251%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F5941%22%20target%3D%22_blank%22%3E%40Joe%20Stocker%3C%2FA%3E%26nbsp%3BMy%20problems%20are%20not%20with%20pure%20lists%20they%20work%20fine%20with%20more%20than%2010%2C000%20items%20so%20far.%3C%2FP%3E%3CP%3EThe%20big%20problem%20is%20with%20files%20in%20libraries%20some%20of%20which%20will%20have%20more%20than%205000%20files%20and%20then%20I%20can't%20add%20more%20files%20or%20publish%20major%20version%20with%20JavaScript%20methods.%3C%2FP%3E%3CP%3EI%20contact%20MS%20support%20and%20they%20have%20no%20solution%20but%20to%20structure%20libraries%20with%20folders%20of%20less%20than%205000%20which%20is%20a%20big%20development%20challenge%20that%20adds%20nothing%20to%20the%20business%20needs.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional 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. https://support.microsoft.com/en-us/office/manage-large-lists-and-libraries-b8588dae-9387-48c2-9248-...

@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