cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

move files with lastmodified date > 30 days to another folder

Hi Everyone,

 

I'm new to Flow, so I'm not sure if this is even possible? Just wondering if someone could provide some feedback? Can the above be achieved?
I see events that are triggered on file creation etc. but not one I can trigger say once a week or once a month etc.

 

Basically what I want to do is search through a document folder and move any file that hasn't been modified for 30 days to an 'Archive' folder?

 

Any comments or suggestions?

 

 

 

Thanks in advance

2 REPLIES 2
Community Support Team
Community Support Team

Re: move files with lastmodified date > 30 days to another folder

Hi @Anonymous,

 

Would you please share information about what the data source you would like to work with?

Actually there is a way to deal with the modified date, first we need the source connection under Microsoft Flow contains the List files in folder Action.

After add the List files in folder action, add a condition, choose the LastModified property as the input of the first Input box, this would add an Apply to Each automatically, after that, click the Advanced mode of condition, copy and paste the following code:

@greaterorequals(sub(int(utcnow('yyyyMMdd')),int(formatdatetime(item()?['LastModified'],'yyyyMMdd'))), 30)

Then under the Yes part, add the Copy file Action, then Add the Delete file Action.

By testing I found some problems when working with the Apply to each, I will update here once I got the response back from PG.

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
mwolf222
Level: Powered On

Re: move files with lastmodified date > 30 days to another folder

I also have need for this.  To move files older than 30 days in one folder to another (archive) folder in the same SharePoint site. 

I guess I need clarification on which triggers, conditions  and actions to use. 

Thank you. 

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 366 members 5,093 guests
Please welcome our newest community members: