Forum Discussion

AjayM's avatar
AjayM
Copper Contributor
Feb 23, 2026

SharePoint List View Threshold Error while Fetching 5000+ Records in list.

I am fetching data from a SharePoint list that contains more than 5000 records inside my function. While retrieving the data, I am getting the following error:

“Flow Reminders→ The attempted operation is prohibited because it exceeds the list view threshold.”

 

Scenario:

  • The SharePoint list has 5000+ items.
  • Data is being fetched programmatically.
  • The error occurs during query execution.

    What I need help with
    What is the recommended and best-practice approach to retrieve large datasets from a SharePoint list without hitting the list view threshold?
    Questions:
  1. What is the recommended approach to fetch large data from a SharePoint list without hitting the list view threshold?

    Any suggestions, examples, or documentation references would be greatly appreciated.

Thanks.

1 Reply

  • Harold-Picado's avatar
    Harold-Picado
    Brass Contributor

    Hi,

    The 5,000 threshold is a hard safeguard in SharePoint Online. Microsoft enforces this strictly for performance and SQL health, so there are no workarounds other than following official standards: indexing and paging.

    Since your error mentions "Flow Reminders", here is the official way to handle this depending on your setup:

    If you are using Power Automate (Flow) You don't need code. Go to the settings of your "Get items" action, turn on Pagination, and set the threshold limit (e.g., 10000). Power Automate will handle the secure batching under the hood.

    Doc: https://learn.microsoft.com/en-us/graph/paging

    Set up Column Indexing (Required for both) If you are filtering your query (like checking a status or date), you must index that column. Go to List Settings -> Indexed Columns and add it. If you try to filter by a non-indexed column on a list with over 5,000 items, SharePoint will block the scan immediately.

    Doc: https://support.microsoft.com/en-us/office/add-an-index-to-a-sharepoint-column-f3f00554-b7dc-44d1-a2ed-d477eac463b0