cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Copy all files from one folder to another within same SharePoint library using Flow

I am trying to use FLOW to automate copying files from one folder (say "Current")  to another folder(say "Archive") within the same library.  But it doesn't seem to work. Do I need to use some dynamic formulas here?

 

Please advice. 

2018-04-13_11-28-14.jpg

 

 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Community Support
Community Support

 

Hi @ Yudistara,

 

 

Do you want to create a flow to copy the file in folder "Current" to folder "Archive" within the same library once a week?

 

If you would like to use the "Copy file" action if sharepoint connector to achieve your needs, you should fill in the file path in the "Source file path" field and "Destination file path" field of "Copy file" action instead of the folder path.

 

Please take a try use the "Create file"action to achieve your needs,and refer to screenshot below to create the flow to achieve your needs:

Capture.PNGCapture1.PNG

 

 

The expression in the "File Identifier" field of "Get file content" action as below:

items('Apply_to_each')?['{Identifier}']
 
The expression in the "File name" field of "Create file" action as below:
items('Apply_to_each')?['{FilenameWithExtension}']
 

 The flow would run successfully to copy all files from folder "Current" to folder "Archive" as screenshot below:

Capture.PNG

 

 

 

Regards,
Alice Zhang

View solution in original post

Highlighted

OK. I figured it out. Thought i need to share it if someone is looking for the solution. 

 

All I had to do was get the files, set up a condition if the "folder path" contains the name of the folder in which the file needs to be deleted from.  (See below screenshot) and then delete the file.

Delete file.jpg

View solution in original post

5 REPLIES 5
Highlighted
Community Support
Community Support

 

Hi @ Yudistara,

 

 

Do you want to create a flow to copy the file in folder "Current" to folder "Archive" within the same library once a week?

 

If you would like to use the "Copy file" action if sharepoint connector to achieve your needs, you should fill in the file path in the "Source file path" field and "Destination file path" field of "Copy file" action instead of the folder path.

 

Please take a try use the "Create file"action to achieve your needs,and refer to screenshot below to create the flow to achieve your needs:

Capture.PNGCapture1.PNG

 

 

The expression in the "File Identifier" field of "Get file content" action as below:

items('Apply_to_each')?['{Identifier}']
 
The expression in the "File name" field of "Create file" action as below:
items('Apply_to_each')?['{FilenameWithExtension}']
 

 The flow would run successfully to copy all files from folder "Current" to folder "Archive" as screenshot below:

Capture.PNG

 

 

 

Regards,
Alice Zhang

View solution in original post

Highlighted

Thank you @. It worked perfectly with your instructions. Thanks a lot again. 

 

But now I am trying to figure out how I can delete the file from "Current" folder in our example. Meaning, once the file is copied to Archive folder, the file needs to be deleted from "Current" folder. 

 

I tried using the "Delete file" action, but not successful. Delete file action also deletes the file from both the folders. I only want to delete the file from the Current folder, but not the Archive folder. Any suggestions are appreciated. 

 

Thanks.

Highlighted

OK. I figured it out. Thought i need to share it if someone is looking for the solution. 

 

All I had to do was get the files, set up a condition if the "folder path" contains the name of the folder in which the file needs to be deleted from.  (See below screenshot) and then delete the file.

Delete file.jpg

View solution in original post

Highlighted

Very useful!

Would it be possible to edit the name of the file by adding today’s date at the end of the file name in the destination file path? I imagine it’d be in the Create File step, but what would the expression be? 

Highlighted
Resident Rockstar
Resident Rockstar

@yxx 

Expression will be something like this

 

concat(split(filename,'.')[0],utcnow('dd/MM/yyyy'),split(filename,'.')[1])

 

 

 

 

If this post helps you with your problem, please mark your as Accepted solution.If you like my response, please give it a Thumbs Up.

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.

Users online (7,900)