Copy Document Library Folder With Content Type Using Power Automate

Introduction

 
In this article, we will learn how can we copy the Document Library folder with content type using MS Flow.
 
There is no action available in MS Flow to copy a document library folder. So, to copy a document library folder with a content library we need to use rest API, and to use rest API in MS flow we will send an HTTP request to SharePoint action.
 

Steps to copy a document library folder with a content type

 
To get started with this example pre-required is in both document libraries have the same content type.
 
Step 1
 
Create automated cloud flow and select trigger Manually trigger a flow.
 
Step 2
 
Now add new action Send an HTTP request to SharePoint.
 
Step 3
 
In a Site Address field, select the Site of your source document library.
 
Step 5
 
In the Method field, select option POST.
 
Step 6
 
In Uri field, enter below Uri,
  1. _api/site/CreateCopyJobs
Step 7
 
In the header, add below key-value pair,
 
accept application/json;odata=verbose
content-type application/json;odata=verbose

Step 8
 
In the Body field, add the below JSON. You can copy the JSON code from below directly into the Body of your action,
  1. {  
  2.     "exportObjectUris": ["https://<Your SharePoint-Online Domain >.sharepoint.com/sites/CDMSmithTest/Document%20Set%20Content%20Type/Hello%20World"],  
  3.     "destinationUri""https://<Your Sharepoint-Online Domain.sharepoint.com/sites/Task1/Document%20Set%20Content%20Type",  
  4.     "options""IgnoreVersionHistory"true,  
  5.     "BypassSharedLock"true  
  6.    }  
  7. }   
Step 9
 
exportObjectUris - In this JSON property give folder path(Source Document Library folder path).
 
Step 10
 
After filling up all fields values, send an HTTP request to SharePoint action which will be displayed as below,
 
 
Once you have configured the action and saved your flow you can click the Test button.
 
Your flow should be successful and you will have a copy Document Library Folder on Destination Url.
 
Hope this article will be helpful!