SharePoint: Loop 5000+ Lists in Batches
SharePoint Online
Feb 4, 2026 12:35 AM

SharePoint: Loop 5000+ Lists in Batches

by HubSite 365 about Alireza Aliabadi

Online Course Creator (79,000 students and counting)

Microsoft guide to batching large SharePoint lists with Power Automate to avoid pagination, speed flows and scale

Key insights

  • List view threshold (5,000)
    SharePoint blocks queries that try to return more than 5,000 items at once, so reads, updates, or deletes over that limit cause errors. Plan around this limit even though lists can store millions of items.
  • Power Automate batching
    Use a nested batching pattern that reads items in repeated 5,000-item chunks to keep flows predictable and fast. This avoids guessing and scales for thousands of items across scheduled or on-demand runs.
  • Marker/helper column
    Add a column to mark which items a flow has processed and update it after each item or batch so subsequent runs skip finished records. This simple flag enables safe pagination without missing or duplicating work.
  • PowerShell SPQuery pagination
    For admin or bulk tasks, run SPQuery with a conservative row limit (for example 2,000) and use ListItemCollectionPosition to track progress. Repeat the query until all batches finish to avoid threshold errors during mass updates or migrations.
  • Indexing and metadata navigation
    Create indexes on common filter columns (Created, Modified, Status, Content Type) and enable metadata navigation so filters run as safe queries. Use view item limits to improve display performance but rely on filtering and indexes to avoid threshold hits.
  • Limitations & best practices (2026)
    Power Automate loops have a practical single-iteration limit around 5,000 items, so prefer batching, test the happy path, and add retry/troubleshooting steps for complex scenarios. Changing the global threshold requires admin rights and can harm overall performance, so use it only when absolutely necessary.

Alireza Aliabadi’s recent YouTube video offers a practical walkthrough for reading large SharePoint lists in batches with Power Automate. He frames the common pain point clearly: SharePoint enforces a list view threshold that often causes queries to fail when they exceed 5,000 items. Consequently, the video focuses on a repeatable batching pattern that keeps flows predictable and avoids brittle hacks. This article summarizes his approach, highlights tradeoffs, and explains alternatives and troubleshooting tips for implementers.


What the Video Covers

First, Aliabadi describes the problem: simple list reads work until pagination, performance, or thresholds break the flow. He then outlines a staged solution that uses a helper marker and nested loops to process items in safe batches. Next, he builds the flow step by step and tests the happy path before addressing more complex failure modes. Finally, he wraps up with practical troubleshooting guidance that you can apply to real projects.


The Core Batching Pattern

The central idea is straightforward: avoid reading more than the threshold at once by processing fixed-size chunks repeatedly. In practice, the video demonstrates adding a helper or marker column to the list that marks which items a flow has already processed, then running a loop that selects the next up-to-threshold set and updates that marker as it goes. This nested loop approach keeps each query under the threshold and lets you handle tens of thousands of items by repeating the chunked reads. As a result, flows remain stable and you reduce surprises caused by pagination.


The pattern does introduce operational decisions: you must choose batch size, marker strategy, and run cadence. For example, smaller batches reduce the chance of throttling and make error recovery easier, but they increase orchestration overhead and total run time. Conversely, larger batches are faster when they succeed but risk hitting limits or timeouts. Aliabadi recommends keeping each loop within the practical limit and testing under expected load to find the best balance for your tenant.


PowerShell and Server-Side Alternatives

For admins who prefer server-side tools, the video also contrasts the Power Automate approach with PowerShell using the SPQuery object and ListItemCollectionPosition. That method sets a safe row limit—often well under the threshold—and uses position tracking to page through results until completion. PowerShell gives direct control for bulk updates, deletions, or migrations and can run faster for one-off administrative tasks because it avoids cloud flow orchestration overhead.


However, PowerShell requires different tradeoffs: it typically needs appropriate admin rights, careful retry and error handling, and attention to throttling at the server level. Moreover, running scripts on a schedule or integrating them into Microsoft 365 workflows is less seamless than using cloud flows, so teams must weigh governance and operational complexity when choosing between approaches.


Performance, Indexing, and Query Design

Beyond batching, Aliabadi emphasizes index and query design to keep operations efficient and scalable. Indexing commonly filtered columns, setting view item limits, and enabling metadata navigation all help minimize scans that trigger threshold errors. Consequently, combining proper indexing with batch reads makes flows more predictable and reduces the number of items the system needs to evaluate on each query.


Even with good indexes, you can still face tradeoffs: strict filtering improves reliability but may require additional columns or changes to user behavior, while broader queries are simpler but risk scanning many items. Therefore, teams should plan list schema and views alongside automation, testing changes in a safe environment before applying them to production lists.


Troubleshooting and Practical Tips

Aliabadi’s video dedicates time to common failure modes and debugging practices, such as handling partial failures, retry logic, and monitoring runs for unexpected timeouts. He shows how to test the “happy path” and then inject edge cases so you can observe how the flow behaves under stress. This methodical testing helps you build robust flows that degrade gracefully instead of failing silently.


In practice, you should also keep an eye on throttling signals from the platform and design flows to back off or split work further when needed. Ultimately, the right solution depends on your environment, required throughput, and tolerance for complexity; combining batching with good indexing and clear monitoring usually offers the best balance between reliability and performance.


Conclusion

Alireza Aliabadi’s tutorial provides a clear, reusable pattern for looping through large SharePoint lists using Power Automate, while also comparing server-side options for administrators. By using a marker column and nested loops, you can process large data sets without tripping the list view threshold, and by contrast, PowerShell gives a different set of tradeoffs better suited to direct admin tasks. Overall, the video is a practical resource for teams that need predictable, scalable list processing and want concrete steps to test and troubleshoot their flows.


SharePoint Online - SharePoint: Loop 5000+ Lists in Batches

Keywords

SharePoint 5000 limit workaround, SharePoint list batching, SharePoint pagination for large lists, SharePoint REST API pagination, CAML query large list, PowerShell loop through SharePoint list, Handle SharePoint list throttling, Microsoft Graph pagination SharePoint