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 / Filter all files / fol...
Power Automate
Unanswered

Filter all files / folders inside SharePoint site that are last modified 2+months

(0) ShareShare
ReportReport
Posted on by 2

Hello,

 

I am working on a flow that looks into a sharepoint site documents, iterate through all folders and subfolders to get me the files that last modified 2+months ago.

 

Attached is the flow I built, seems to be working fine on small sites, but I have a site that contains around 1TB of data and 5000+ files, the flow keeps running indefinitely, left it for 40 hours last time with no luck, had to cancel it.

 

Any idea ? Attached is the flow.

 

I am using this when comparing in the condition: 

 

formateDateTime(addToTime(utcNow(), -2,'Month'),'yyy-MM')

Categories:
I have the same question (0)
  • AndreasN Profile Picture
    318 Super User 2024 Season 1 on at

    Place the filter query on the first "get files", so the flow doesn't have to iterate through all 5000+ files multiple times.

     

    Filter query expression:
    Modified eq 'formateDateTime(addToTime(utcNow(), -2,'Month'),'yyy-MM')'

    This should smoothen the flow out dramatically, the only files you will get in your "get files" output, are the ones within the past two months, everything is filtered away at the start.

  • esfeir44 Profile Picture
    2 on at

    Hello!

     

    thank you for this! Unfortunately this does not help, as the main folder date is old, but there are some subfolders inside that are new, that way, the script does not cycle through the nested items 😕

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 507 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 267 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard