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 from SharePo...
Power Automate
Unanswered

Get Items from SharePoint List is empty despite hundreds of thousands of rows

(0) ShareShare
ReportReport
Posted on by 13

Ignoring the awful reality that is storing almost 700,000 records in a SharePoint List, I'm trying to archive records by using a Power Automate Flow to move records into separate smaller list (as in records created in 2020, records created in 2021, etc).

The Flow was set to grab the top 5000 records where Created Date was between 01/01/2020 and 12/31/2020, sorted ascending. With that list I created them in a new list then deleted them from the old list.

The first time this ran it worked perfectly.

The second time it ran it found no records for 2020. I confirmed records still exist for 2020.

 

This is what my Get Items looks like

tomholb_0-1651151006641.png

Is it possible that the Delete from List action does more of a soft delete in SharePoint and the Get Items still sees those first 5000 records but is unable to collect their data?

 

Categories:
I have the same question (0)
  • ScottShearer Profile Picture
    25,270 Most Valuable Professional on at

    @tomholb 

    Are you saying that your Flow ran without error but the items did not get created in the new list and were not deleted from the original list?

    If so, take a look at the output of the first time that you ran the Flow.  Can you see in the run that new items were created and existing items deleted?

     

  • tomholb Profile Picture
    13 on at

    @Scott Thanks for the reply.

    I'm saying that the flow ran without error last week (I went and checked the raw input and output as you suggested to make sure), but now is collecting 0 items when it goes to run and execute the Get Items action despite there being several thousand items that it should retrieve.

  • ScottShearer Profile Picture
    25,270 Most Valuable Professional on at

    @tomholb 

    Can you post a screen shot of the first run?

     

  • tomholb Profile Picture
    13 on at

    Of course! I've had to block off some details since this is a semi-confidential dataset and I work for a government agency, but let me know if you require additional information/screenshots.

    flow_orig_run_1.PNG

     

    flow_orig_run_2.PNG

     

    flow_orig_run_3.PNG

  • ScottShearer Profile Picture
    25,270 Most Valuable Professional on at

    @tomholb 

    I'm not quite sure yet what the issue may be but I would like to try a couple of tests if you don't mind.

    I am assuming that you have the standard license that comes with M365.

    1. Create a new Flow that starts with a button
    2. Add a Get items action on the original list
      1. Turn on pagination and set the threshold to 5000
      2. Sort by ID asc
    3. Add a loop to loop through the items returned
      1. Add a compose action inside of the loop - set it to the created date
    4. Run the Flow

    Please let me know what you see in the loop as far as the created date please.

     

  • tomholb Profile Picture
    13 on at

    @ScottShearer 

    See below!

    flow_orig_run_4.PNG

    flow_orig_run_5.PNG

  • Verified answer
    ScottShearer Profile Picture
    25,270 Most Valuable Professional on at

    @tomholb 

    Great!

    No add the filter query and run it again and post a new screen shot of the run please

  • tomholb Profile Picture
    13 on at

    @ScottShearer 

    Adding in my filter query and running it worked. I incorporated it into my original flow and it appears to be doing just fine now.

    Not quite sure I understand what caused it. Was Pagination Key? Using ID to sort instead of a Date?

  • Verified answer
    ScottShearer Profile Picture
    25,270 Most Valuable Professional on at

    @tomholb 

    I have seen some weirdness when I specify top count - that may have been the issue.  Top count is not necessary in your circumstances.

    Also, you could substantially speed up your Flow by having the delete item action immediately follow the create item action in the same loop.  The second loop is likely adding a bunch of time.

     

  • tu22 Profile Picture
    44 on at

    can anyone help with this

     

    tu22_0-1667564110815.png

     

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
Michael E. Gernaey Profile Picture

Michael E. Gernaey 523 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 406 Moderator

#3
abm abm Profile Picture

abm abm 245 Most Valuable Professional

Last 30 days Overall leaderboard