Hello!
I am trying to create a flow to do the following:
Search in a document library for files that haven't been modified in 2 years. If the flow locates a file that matches the condition, this file needs to be moved to an archive library that is on the same site.
The tricky part is that the file must keep the same folder structure when moved.
Also, the folder structure on the source site must not be deleted, since there may be files in the same folder with different modified dates.
Anyone have an idea on how to approach this or have a flow that does the same thing?
Hi,
Tricky part is not so tricky, before using 'Move file' action, use a 'Create folder' action. give it the file folder path minus source library name. It will create the file destination folder hierarchy in a throw. Use slice() function to remove library reference from source file path:
slice(outputs('Get_file_properties')?['body/{Path}'], indexOf(outputs('Get_file_properties')?['body/{Path}'], '/'))
If I have answered your question, please Accept the post as solution.
If you like my response, please Thumbs Up.
WarrenBelz
146,743
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,079
Most Valuable Professional