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 / Move files older than ...
Power Automate
Answered

Move files older than 30 days to another SharePoint library

(0) ShareShare
ReportReport
Posted on by 6

Hi Guys,

 

I am new to flow and I am trying to achieve the following. I need to create a flow that will run on a schedule. The flow needs to identify files in a document library, whose modified date is older than 3 years. It then needs to grab these files and move them to another document library called Archived.

 

Any advice would be greatly appreciated 

Categories:
I have the same question (0)
  • Verified answer
    v-yuazh-msft Profile Picture
    on at

    Hi @Goose05,

     

    You could refer to screenshot below to create the flow to move file from library1 to library2 when the file is older than 30 days:

    Capture.PNG

    Capture.PNG

     

    The expression in the Condition as below:

    @lessOrEquals(items('Apply_to_each')?['Modified'], addDays(utcNow(), -30))

    If you want to move file from library1 to library2 when the file is older than 3 years, the expression should as below:

    @lessOrEquals(items('Apply_to_each')?['Modified'], subtractFromTime(utcNow(), 3, 'Year'))

     

    Best regards,

    Alice

     

     

     

  • CSIDavids Profile Picture
    2 on at

    I am getting an error that the expression is not valid. I am using this one:

    @lessOrEquals(items('Apply_to_each')?['Modified'], subtractFromTime(utcNow(), 3, 'Year'))
  • Community Power Platform Member Profile Picture
    on at

    Hi I have attempted the same solution on my side and I am getting a "Action 'Get_file_content' failed" error. I am trying to archive files from one library to a another library within the same share point. The flow does work if I try to archive within the same library. 

     

    {
      "status"404,
      "message""File not found\r\nclientRequestId: "
    }
  • gapparicio Profile Picture
    2 on at

    I would like to add a parameter: EMAILS THAT THE SUBJECT CONTAINS "ABC123".

    Can you help me please?

  • abrarali Profile Picture
    8 on at

    I have tried recreating the flow, but getting the error: {
    "status": 404,
    "message": "File not found\r\nclientRequestId: 9d411da1-1aa1-4a0d-a8af-e4ac594a3933\r\nserviceRequestId: 9d411da1-1aa1-4a0d-a8af-e4ac594a3933"
    }

    Screenshot 2023-12-14 at 8.22.31 PM.png

     

    Can someone provide any suggestions?

  • CU29071423-0 Profile Picture
    134 on at
    Everything looks easy, however PA copy or move for files have known problems in Sharepoint as of Aug 2025, in my case I never get same number of rows on target vs source Excel file, some rows just got lost.

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

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard