cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Yudistara
Level: Powered On

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

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

 

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

Yudistara
Level: Powered On

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

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

3 REPLIES 3
Community Support Team
Community Support Team

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

 

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

Yudistara
Level: Powered On

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

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.

Yudistara
Level: Powered On

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

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

Helpful resources

Announcements
firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

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

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

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 Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (6,098)