A family of Microsoft on-premises document management and storage systems.
Hi Ajay Mahajan,
Thank you for posting your question in the Microsoft Q&A forum.
Based on my research, Microsoft has a dedicated article for SharePoint Server titled Working with the List View Threshold limit for SharePoint Server only, which outlines multiple approaches you can consider (for example, using a Daily Time Window and noting that an administrator can choose to raise the limit in SharePoint Server). However, Microsoft also explicitly advises against changing query throttling thresholds, because the default threshold is tied to SQL Server locking behavior and raising it can negatively affect overall throughput. So, increasing the limit should be treated only as a temporary stopgap or used in very highly controlled environments, rather than as a best-practice fix.
Below are a few workarounds I’ve seen others recommend that you may want to apply by rewriting your function to handle large datasets more gracefully:
1) Indexed Columns
If your query involves filtering (for example, using $filter), the column being filtered should be indexed in List Settings so SharePoint can execute the query efficiently. If a column is not indexed, SharePoint has to scan the entire list to find matches, immediately hitting the 5000-item limit.
2) Implement Pagination
Use pagination to fetch data in batches (for example, $top=5000 or a lower number like $top=1000). In REST responses (commonly with application/json;odata=verbose), users often handle paging by following the data.d.__next URL until it is no longer returned, which indicates there are no more pages.
Best practice implementation pattern: loop (or recurse) and continue calling the returned __next URL until it becomes null / absent.
3) Server-Side Filtering & Selection
-
$filter: Apply filters so the dataset returned per batch is as small as possible (reduce the workload of each query). -
$select: Request only the specific columns needed by your function to reduce payload size and improve execution time.
I hope the above information is helpful.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.