cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Goose05
Level: Powered On

Move files older than 30 days to another SharePoint library

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 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Move files older than 30 days to another SharePoint library

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

 

 

 

View solution in original post

2 REPLIES 2
Community Support Team
Community Support Team

Re: Move files older than 30 days to another SharePoint library

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

 

 

 

View solution in original post

CSIDavids
Level: Power Up

Re: Move files older than 30 days to another SharePoint library

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'))

Helpful resources

Announcements
firstImage

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

firstImage

Coming Soon: T-shirt Design Contest

Keep your eyes open for our upcoming T-shirt design contest!

firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Top Solution Authors
Top Kudoed Authors
Users online (5,934)