web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Get items limit odata....
Power Automate
Suggested Answer

Get items limit odata.nextLink workaround stuck at the 21st loop (when going over 100k?)

(1) ShareShare
ReportReport
Posted on by 179
Hello everyone!
 
My goal is to scan all files of a sharepoint and save access permissions in a csv. I found a great tutorial here ( https://www.youtube.com/watch?v=28fNiVj2J0o ) to skip the 5000 limit and it works well but my loop gets stuck on the same file over and over after the 21st loop. I can't find why but all I know is the fileID it starts with on all loops after 21st is the same making it loop indefinitely.
 
Any idea why I get this result?
 
Here is a screenshot of the flow : 
 
Categories:
I have the same question (0)
  • Suggested answer
    Valantis Profile Picture
    6,735 on at
    Hi @Volt26,
     
    Switch from `nextLink` to filtering by ID. It's faster and handles millions of items.
    Here's what to do:
    1. Create a variable called `varLastID` and set it to `0` (integer type)
     
    2. Change your HTTP request to get 5,000 items where the ID is greater than the last one you processed. Make sure to add `&$orderby=ID asc` to your query or it won't work.
     
    3. At the end of each loop, update `varLastID` to the ID of the last item in the batch. Use this expression:
    `last(body('Send_an_HTTP_request_to_SharePoint')['d']['results'])?['ID']`
     
    4. Keep looping until you get back 0 items.
     
     
    Let me know if that worked out for you.
  • Volt26 Profile Picture
    179 on at
    Thank you for your reply
    I'm currently testing it, it takes a long time to see if it will "crash" or not at 100k but everything looks fine on "paper" :)
     
    I'll post again when I can confirm it works
  • Valantis Profile Picture
    6,735 on at
    Hi @Volt26,
     

    Just wanted to check in and see if everything is working now.

    Also, if the issue is resolved, it would be great if you could mark the answer as solved so others with the same question can find it easily.

    Thanks and have a great day!

  • Valantis Profile Picture
    6,735 on at
    Hi @Volt26,
     
    got any feedback for me on the issue? how went the testing?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 377

#2
11manish Profile Picture

11manish 279

#3
David_MA Profile Picture

David_MA 234 Super User 2026 Season 1

Last 30 days Overall leaderboard