I have a document library in which the contents were recently migrated from a file server.
This library has a list of folders, within those folders live several files. If none of the files within the folder have been modified in the prior month, the folder should be moved to archive. When these files lived on the file server, modifying any file also modified the folder date. So moving these folders manually once per month was easy. Now that it's in SharePoint, modifying the files does nothing to the folders. So it's become a problem.
I can either build a flow that looks inside the individual folders and moves the folder if the files contained withing weren't modified in the prior month.
I can build a flow that compares a list of entries in an excel spreadsheet column to the list of folders and move any folders that do not exist in the Excel spreadsheet.
I'm not sure if this is entirely clear but please let me know if you have any suggestions on how to achieve either of these objectives. I can't seem to figure out how to attack this.
Thanks for any suggestions!!!
Avoid using Excel in your Flows if at all possible, due ot their very heavy limitations. You could use a SharePoint List for this task, but I think your first idea is likely the best way to attack it. All you have to do is use the Get files action for the document Library and use the ODATA Filter to filter out recently updated files, and utilize an Add a condition to a flow.
Here's a look at the Supported OData query options, which includes date/time:
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
Thanks for the direction. The Excel idea only came up because they regularly export a CSV list of active employees that they work off of. I'll scrap that and work from your suggestions. I'll report back with results/challenges. Appreciate it!
Hello @jaybertx ,
You can configure your flow as shown in the screenshots below，
Step1: Add List folder action to get the file of folder.
Step2: Add Apply to each action, and put in actions Filter array, to filter each file within folder whether have been modified in the prior month.
The first blank:
The second blank:
addDays(utcNow(), -30, 'yyyy-MM-dd')
Step3: set condition, and judge the length of "Filter array" output whether is 0.
-If yes, Move folder.
-If no, do nothing.
If you have any questions, please contact us again.
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Three Super User rank tiers have been launched!
Features releasing from October 2020 through March 2021
We've updated and improved the layout and uploading format of the Power Automate Cookbook!
Fill out a quick form to claim your user group badge now!