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

Notifications

Announcements

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)
  • Valantis Profile Picture
    698 on at
    Hi @Volt26,
     
    got any feedback for me on the issue? how went the testing?
  • Valantis Profile Picture
    698 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!

  • 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
  • Suggested answer
    Valantis Profile Picture
    698 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.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 245 Super User 2025 Season 2

#2
trice602 Profile Picture

trice602 228 Super User 2025 Season 2

#3
Expiscornovus Profile Picture

Expiscornovus 188 Most Valuable Professional

Last 30 days Overall leaderboard