cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

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
Highlighted
Community Support
Community Support

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

3 REPLIES 3
Highlighted
Community Support
Community Support

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

Highlighted

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

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: "
}

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Top Solution Authors
Top Kudoed Authors
Users online (3,804)