microsoft-graph-apisharepoint-onlinesharepoint-rest-api

Graph query on SharePoint Libraray with Paging


I have libraries containing way more than 5000 files When using:

https://graph.microsoft.com/v1.0/sites/3a8180fe-ca21-40a8-81e6-0950f5966f07/lists/DPC Documents/Items?top=499&$expand=fields&$filter=fields/FileLeafRef eq '0100.009_Client Name_Physician Name_FMV Exhibits_466689.XLSX'

I Get error "The request is unprocessable because it uses too many resources" I can I ask for it to be paged?

BTW equivalent SharePoint REST call returns "The attempted operation is prohibited because it exceeds the list view threshold."

So there is no way to look for items in lists containing more than 5000 items. I noticed I can't publish major version programmatically in such libraries.

I MS not supporting any API to work with this?

Thanks


Solution

  • This is most probably due to the reason that you have more than 5000 files in the doc library and the filter column FileLeafRef is not indexed (you cannot add index this column either). I encountered same error when filtering with a custom metadata column but fortunately after adding the index to the column, the error went away. The only solution to your problem is not to use FileLeafRef as your filter column but use the Title column in the filter condition, after ensuring that Title column is populated with name of the document and the column is indexed.