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.
Create automated cloud flow and select trigger Manually trigger a flow.
Now add new action Send an HTTP request to SharePoint.
In a Site Address field, select the Site of your source document library.
In the Method field, select option POST.
In Uri field, enter below Uri,
In the header, add below key-value pair,
In the Body field, add the below JSON. You can copy the JSON code from below directly into the Body of your action,
- "exportObjectUris": ["https://<Your SharePoint-Online Domain >.sharepoint.com/sites/CDMSmithTest/Document%20Set%20Content%20Type/Hello%20World"],
- "destinationUri": "https://<Your Sharepoint-Online Domain.sharepoint.com/sites/Task1/Document%20Set%20Content%20Type",
- "options": "IgnoreVersionHistory": true,
- "BypassSharedLock": true
exportObjectUris - In this JSON property give folder path(Source Document Library folder path).
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!