Power Automate Copy Folders + 10 Examples

In this Microsoft Power Automate Tutorial, we will see what is a Power Automate Copy folder action, and what its used in Microsoft flow.

Also, we will discuss what is the copy folder structure, How to copy the SharePoint folder, How to copy a folder with a new name in Microsoft flow, and so on.

Also, by taking some different scenarios, we will cover these below topics:

  • Power Automate copy folder contents from OneDrive to another
  • Power Automate copy folder and files
  • Power Automate copy folder and subfolders
  • Power Automate copy SharePoint folder to another on a recurring basis
  • Power Automate copy SharePoint folder to onedrive
  • Power Automate copy email attachments to SharePoint folder
  • Power Automate for SharePoint folder permissions

Power Automate copy folder

In Power Automate, there is an action under the SharePoint connector named ‘Copy folder‘ that is used to copy a folder. It works in a similar way to the “Copy to” command in SharePoint libraries.

This action returns information about the new folder after copy. It needs some parameters to activate the action such as:

  • Current Site Address– Specify the current SharePoint site adress.
  • Folder to Copy– Select the folder using the folder path that you want to copy.
  • Destination Site Address– Specify the destination SharePoint site address.
  • Destination Folder– Select the destination folder path where you want to store the copied folder.
  • If another folder is already there– Select a action if another folder is alredy exist with same name.
    • Copy with a new name- It will copy the folder with a new name if the folder is already there.
    • Fail this action- It will fail the action if the folder is laredy exist.
    • Replace– It will replace the older folder with the new folder.
Power Automate copy folder
Power Automate copy folder

This is how the copy folder works on Power Automate.

Also read: Power Automate Copy Files + 21 Examples

Power Automate copy folder structure

In Power Automate, the copy folder structure means copying only the folders and the documents in the root folder.

For example, we have some files in a subfolder in a SharePoint Document Library.

Power Automate copy folder structure
Power Automate copy folder structure

Let’s check this folder structure by clicking on Show picker in the Copy folder action.

Copy folder structure in Power Automate
Copy folder structure in Power Automate

Here the ‘/Shared Documents’ is the root folder and ‘/Shared Documents/Files/Image‘ is deep in the folder structure. This is how to show the folder structure in the copy folder using Power Automate.

Read: Power Automate Create PDF + 11 Examples

Power Automate copy sharePoint folder

Now, we will see how to copy the SharePoint folder from one library to another library within SharePoint. Before creating a flow make sure to log in the Power Automate with the Microsoft tenant address.

For example, we have an image folder having some images in one of the SharePoint document libraries and we want to copy this folder to another document library.

Power Automate copy folder from one library to another
Power Automate copy folder from one library to another

Let’s create an instant cloud flow to copy folders from one document library to another. Click on + create > Instant cloud flow. Select the trigger to start the button flow ‘Manually trigger a flow.

Trigger the flow manually in Power Automate
Trigger the flow manually in Power Automate

Under the trigger, we will add a new action that will get all the information about the folder using a file identifier. Click on +New step > Select the action ‘Get folder metadata‘.

Power Automate copy SharePoint folder
Power Automate copy SharePoint folder

Here we will set the Site address and in the file identifier, select the folder that we want to copy i.e. Image.

copy SharePoint folder using Power Automate
copy SharePoint folder using Power Automate

Next, we will add an action that will copy the folder from the source library to the destination library. Click on + New step > Search the action ‘Copy folder‘.

Copy folders between SharePoint libraries using Power Automate
Copy folders between SharePoint libraries using Power Automate

Then it will ask to set the below parameters to activate the action:

  • Current Site Address– Set the Current SharePoint site address
  • Folder to Copy– Select ID from the dynamic content of the Get folder metadata
  • Destination Site Address– Set the destination SharePoint address
  • Destination Folder– Choose a folder path or document library where you want to store the copied file.
  • If another folder is already there– Select Copy with a new name.
How to copy files from one SharePoint site to another
How to copy files from one SharePoint site to another

Let’s save the flow and test it manually. We can see the flow ran successfully with a green tick. Also, we can see the Image folder has been copied to the destination folder with items.

copy sharePoint folder using Microsoft flow
copy SharePoint folder using Microsoft flow

This is how to copy the SharePoint folder using Microsoft flow.

Also, read this tutorial: Power Automate dynamic content [Complete tutorial]

Power Automate copy folder with a new name

Here we will see how to copy a folder with a new name using Power Automate. For example, we have a folder named ‘Files‘ in the source library.

copy folder with a new name Using Power Automate
copy folder with a new name Using Power Automate

Let’s create an instant flow that will copy the folder from one SharePoint library to another and store it in a new name.

On Power Automate, go to +Create > Instant cloud flow > Trigger the flow manually. Then click on the +New step to add the logical action.

Copy & Rename Folders to new SharePoint library using Power Automate
Copy & Rename Folders to new SharePoint library using Power Automate

Search for Copy folder action. Select the action under the Sharepoint connector. Provide the Current Site Address, Folder to Copy, Destination Site Address, Destination Folder, and in the ‘If another folder is already there‘ set as Copy with a new name.

 copy folder with a new name using flow
copy folder with a new name using flow

Then Save the flow. Test it manually. We can see the folder will copy from the destination folder to the source folder.

Microsoft flow  copy folder with a new name
Microsoft flow copy folder with a new name

As the folder is copied, If we rerun the flow it will copy the folder with a new name:

Copy a folder with a rename in Power Automate
Copy a folder with a rename in Power Automate

This is how to copy a folder with a rename in Power Automate.

Read: Start and wait for an approval Power Automate [Complete tutorial]

Power Automate copy folder and subfolders

Similarly, here we will see how to copy folders and subfolders from one SharePoint document library to another. For example, we have a folder named ‘Files‘ having 2 subfolders with some random documents inside them i.e. Image, SubFiles.

Power Automate how to copy folder and subfolders
Power Automate how to copy folder and subfolders

Now we will create a button flow, that will copy all these subfolders and folders from the source library to the destination library location on the same site (or you can set the different SharePoint site addresses).

On Power Automate, Click on My flows > +New flow > Instant cloud flow.

copy folder and subfolders using flow
copy folder and subfolders using flow

Then select the trigger to start the flow manually i.e. Trigger the flow manually.

trigger the flow manually and add new action in Power Automate
Trigger the flow manually and add a new action in Power Automate

Next, click on the +New step to add the logical action in the flow. Select the Copy folder action.

How to copy folder and subfolders using Power Automate
How to copy folder and subfolders using Power Automate

Let’s Save the flow and test it manually. We can see the folder and subfolders have been copied to the destination library.

How to copy Sharepoint folder including sub folders using Power Automate
How to copy Sharepoint folder including subfolders using Power Automate

This is how to copy the Sharepoint folder including the subfolders using Power Automate.

Check out this tutorial: Power Automate flow with Microsoft teams

Power Automate copy folder and files

Here we will see how to copy folders including files from one document library to another document library using different SharePoint site addresses.

For example, we have some random files and folders in one document library i.e. the Source document library.

Power Automate copy folder and files
Power Automate copy folder and files

Let’s create an instant flow that will copy all these folders including files from this source library to the destination library using different Sharepoint site addresses.

On Power Automate, go to + Create > Instant cloud flow > Select the trigger ‘Manually trigger a flow‘.

Then (under the trigger) click on + New step > Get folder metadata action. This action will get the information about the folder by using a file identifier to pick the folder. Here we will set the below parameters such as:

  • Site Address– Set the source site address
  • File Identifier– Set the folder path from where you will get the folder metadata.
Microsoft flow copy folder and files
Microsoft flow copy folder and files

Next, we will add an action that will copy the folder from the source site address to another. Click on + New step > Copy folder. Then set the below properties such as

  • Current Site Address– Set the source SharePoint site address
  • Folder to Copy– Select ID from dynamic contnet of the Get folder metadata.
  • Destination Site Address– Set the destination site address
  • Destination Folder– Set the destination document library where want to store the copied files and folders
  • If another folder is already there– Set as copy with a new name
How to copy folder and files using Power Automate
How to copy folder and files using Power Automate

Let’s save the flow and test it manually. Then click on run the flow.

Flow for copying files and folders between two SharePoint library
Flow for copying files and folders between two SharePoint library

We can see the folders and the files move from the source library to the destination library.

How to copy folder and files using Microsoft flow
How to copy folder and files using Microsoft flow

This is how to copy folders and files using Microsoft flow.

Also, you can read: Power Automate or Microsoft Flow delete all files in a folder

Power Automate copy SharePoint folder to onedrive

Here we will see how to copy folders from the Sharepoint library to OneDrive. In SharePoint, there is an option ‘Copy to‘ that will copy folders, subfolders, and files from Sharepoint to OneDrive without using any flow.

For example, we have some random folders in the Sharepoint Document library. Let’s select those folders that you want to copy.

 copy SharePoint folder to onedrive
copy SharePoint folder to onedrive

Then click on Copy to, it will show the destination location where we will store the copied folder inside the OneDrive.

 copy folder from SharePoint to OneDrive
copy folder from SharePoint to OneDrive

Select ‘Your OneDrive‘ to choose a folder or you can create a new folder to store the copied folders. For example, we will create a new folder named ‘Copied Folder from SharePoint‘. Then click on ‘copy here‘.

Copy folders from SharePoint library to OneDrive Power Automate
Copy folders from SharePoint library to OneDrive Power Automate

Then again select the folder and click on ‘Copy here‘.

How to copy folders from SharePoint library to OneDrive
How to copy folders from SharePoint library to OneDrive

Now we can see the foders are copied to the OneDrive location.

How to copy SharePoint folders to OneDrive
How to copy SharePoint folders to OneDrive

This is how to copy SharePoint folders to OneDrive.

Read: Power Automate add days to date

Power Automate copy SharePoint folder to another on a recurring basis

Now we will see how to copy the SharePoint folder from One SharePoint site to another on a recurring basis i.e. we can copy the folders on a particular time basis.

For example, we have some files and folders in a SharePoint document library and we want to copy these folders from one site to another on the basis of recurrence.

copy SharePoint folder to another on a recurring basis
copy SharePoint folder to another on a recurring basis

Let’s create a scheduled cloud flow that will copy folders from one SharePoint site to another.

On Power Automate, click on + Create > scheduled cloud flow.

Create a scheduled cloud flow
Create a scheduled cloud flow

Here we will give a flow name and set the time, day. For example, we want to repeat this flow repeats every 1 day. Then click on create.

copy SharePoint folders to another on a recurring basis
copy SharePoint folders to another on a recurring basis

It will trigger the flow once a day according to date and time. Now, we will add the logical action in the flow. For this, click on the +New step (under the recurrence trigger).

copy SharePoint folder to another on a recurring basis using Power Automate
copy SharePoint folder to another on a recurring basis using Power Automate

Then search the action ‘Copy folder‘ under the SharePoint connector and select the action to add it to the flow.

Copy one SharePoint folder to another on a recurring basis
Copy one SharePoint folder to another on a recurring basis

Next, we provide the Current Site Address, Folder to Copy, Destination Site Address, Destination Folder, If another folder is already there.

Power Automate copy SharePoint folder to another on a recurring basis
Power Automate copy SharePoint folder to another on a recurring basis

Then Save the flow and test it manually. We can see the file has been copied to the destination library i.e Copied documents of the SharePoint Guides.

Flow to copy SharePoint folder to another on a recurring basis
Flow to copy SharePoint folder to another on a recurring basis

This is how to copy the SharePoint folder to another on a recurring basis using Power Automate.

Check out this tutorial: Power Automate Increment Variable + 11 Examples

Power Automate copy folder contents from OneDrive to another

Here we will see how to copy folder contents with subfolder from the OneDrive to another using Power Automate flow.

For example, we have a folder with some subfolders and documents in the OneDrive root folder.

Copy folder contents into a new folder
Copy folder contents into a new folder

This Image folder has a subfolder and that subfolder has some random files.

Let’s create an instant cloud flow that will copy all the folders and the subfolders with the folder content into a new folder.

On Power Automate, click on +Create > Instant cloud flow > Select ‘Trigger the flow manually‘.

Under the trigger, click on +New step > Select the action ‘List files in folder‘ under the OneDrive connector. Here we will provide the folder path that you want to copy.

Copy folder contents into a new folder using Power Automate
Copy folder contents into a new folder using Power Automate

Next, we will add an action that will copy all the folder content including the subfolders to the destination folder in OneDrive. Click on +New step > Copy file. Then set the below properties to activate the action:

  • File– Select id from the dynamic content.
  • Destination File Path– Give a destination folder path or you can create a new folder using ‘/‘ and select display name from the dynamic content(ex- /new folder name/Display name).
  • Overwrite– Yes
Power Automate copy folder contents from OneDrive to another
Power Automate copy folder contents from OneDrive to another

Let’s save the flow and test it manually. In OneDrive, we can see it will create a new folder named ‘Copy contents‘ with copied subfolders.

Power Automate Copying of Nested Folder Structure in OneDrive
Power Automate Copying of Nested Folder Structure in OneDrive

This is how to copy folder contents into a new folder using Power Automate.

Read: Power Automate SharePoint Get items filter query contains is not valid

Power Automate copy email attachment to folder

Here we will see how to copy the email attachment(s) to the SharePoint folder using Power Automate.

Let’s create an automated flow that will copy all the attachments to a SharePoint folder.

On Power Automate, go to +Create > Automated cloud flow > Select a trigger ‘When a new email arrives (V3)‘. Select the folder to where the email will arrive i.e. Inbox.

power automate copy email attachment to folder
Power Automate copy email attachment to folder

Then we will add an action that will copy the email attachments to the SharePoint folder.

Click on +New step > Create file(under the SharePoint). Set the properties like below:

  • Site Address– Set the SharePoint site address.
  • Folder Path– Select the folder path where you want to store the email attchment.
  • File Name– Choose Attachments name from the dynamic content.
  • File Content– Choose Attachements Content from the dynamic content.
copy email attachments to folder using Power Automate
copy email attachments to folder using Power Automate

Let’s save the flow and test it manually. For testing purposes, we will send an email with attachments to ourselves.

Power Automate copy email to folder
Power Automate copy email to a folder

We can see all the attachments will save automatically in the SharePoint folder.

Microsoft flow copy email attachment to folder
Microsoft flow copy email attachments to a folder

This is how to copy email attachments to a folder.

To find more details about it, refer to this link: Power Automate save email attachment to SharePoint

Power Automate copy folder source or destination likely invalid

  • In Power Automate, while copying a folder from the source folder to another SharePoint folder, sometimes we may get errors like Source or Destination likely invalid. Check if the item or destination has been deleted. (Status Code: 400,  Bad Request).
  • You can view the error in the below image. To overcome this type of error, you can try this Power Automate forum post link: Copy folder source or destination likely invalid in Microsoft flow.
Power Automate copy folder source or destination likely invalid
Power Automate copy folder source or destination likely invalid

Read Power Automate OData filter query with examples

Power Automate copy folder permissions

Using Power Automate, we can set permission on documents or folders in the SharePoint document library using Grant Permissions action.

We can find this action, by following these steps:

On document library, go to Settings > Document library settings > Permission for this document library(Permission and Management) > Click on Stop inheriting permissions. So that we can create unique permissions for this document library.

Set SharePoint Folder Permissions with Power Automate
Set SharePoint Folder Permissions with Power Automate

For this, we will create an automated flow that will set unique permission to the document library with Power Automate.

Let’s create a flow that will trigger when a folder is created. On Power Automate, click on +Create > Automated cloud flow > trigger the flow ‘When a file is created (properties only)‘.

power automate copy folder permissions
Power Automate copy folder permissions

Then we will configure the trigger with the Site address and the library name.

How do I add permissions to folder after it is created with flow
How do I add permissions to folder after it is created with flow

Next, we will add an action that will grant access to an item or a folder in SharePoint to specific people.

Click on +New step > Select the action Grant access to an item or a folder. Set the properties like below:

  • Site Address– Specify the Site address
  • List or Library Name-set the document library name
  • Id– Select Id from the dynamic content
  • Recipients– Set the recipients who will receive the sharing invitation
  • Roles-Specify the role such as can edit, can view that is to be granted to the recipients.
  • Notify Recipients– Specify whether recipients should recieve an email notification message.
Power Automate and SharePoint Permissions on folders
Power Automate and SharePoint Permissions on folders

Let’s save the flow and test it manually. Then we will create a new folder in the document library.

Set a permission on SharePoint folder using flow
Set permission on SharePoint folder using flow

Also, we can see it will send a notification to user4 via Outlook.

Set Unique permissions for folder in SharePoint using Power Automate
Set Unique permissions for folder in SharePoint using Power Automate

We can check that, User4 does not have any permission or option to edit the folder as we set it can only view it.

PowerAutomate for SharePoint folder permissions
PowerAutomate for SharePoint folder permissions

This is how to set unique permission on the SharePoint folder using Power Automate.

Also, you may like the below Power Automate tutorials:

Conclusion

From this Power Automate Tutorial, we learned all about copy folder action. Also, we discussed the below topics as:

  • How to use Power Automate copy folder?
  • What is copy folder structure in Power Automate?
  • How to copy sharePoint folder using Power Automate?
  • How to copy folder with a new name using Power Automate?
  • How to copy SharePoint folder and subfolders using Power Automate?
  • What is copy folder including files using Power Automate?
  • How to copy SharePoint folder to onedrive
  • Work with copy SharePoint folder to another on a recurring basis using flow?
  • How to copy folder contents from OneDrive to another using Microsoft flow?
  • Copy email attachment to a SharePoint folder using Power Automate?
  • How to set an unique permission on the SharePoint folder using Power Automate?
  • Thank you Bijay, very useful! I work with libraries that often may have more than 50,000 files, in folder structures. Files may have been tagged with retention labels. Are there any showstoppers you may warn about when dealing with large libraries and the workflows you presented?

    Cheers!

  • >