Skip to main content

Notifications

Community site session details

Community site session details

Session Id : kpYK5WJG0sjZGsaoseIHAp
Power Automate - Building Flows
Unanswered

How to copy or move document sets from one library to another in SharePoint using Power Automate

Like (1) ShareShare
ReportReport
Posted on 14 Mar 2025 12:47:10 by 47
I have 2 libraries with the same content type for document sets.
I'm trying to move the document set from one library to another (Active and Archive)
 
I'm using the action "Send an HTTP request to SharePoint"
 
Here's the setup I have
 
method = post
uri = /_api/site/CreateCopyJobs
headers:
Accept - application/json;odata=verbose
Content-Type - application/json;odata=verbose
Json:
{
  "exportObjectUris": ["https://<tenantname>.sharepoint.com/sites/<sitename>/<library>/<doc set name>"],
  "destinationUri": "https://<tenantName>/sites/<sitename>/<archive library>/",
  "options": {
    "IgnoreVersionHistory": false,
    "IsMoveMode": true
}
}
 
I'm getting a 400 bad gateway.
 
 
 
I've tried modifying the JSON Option
{
  "exportObjectUris": ["https://<tenantname>.sharepoint.com/sites/<sitename>/<library>/<doc set name>"],
  "destinationUri": "https://<tenantName>/sites/<sitename>/<archive library>/",
  "options": {
    "IgnoreVersionHistory": false,
    "IsMoveMode": true,
    "AllowSchemaMismatch": true,
    "AllowSmallerVersionLimitOnDestination": true,
    "NameConflictBehavior": "replace",
    "IncludeItemPermissions": false,
    "BypassSharedLock": true,
    "ExcludeChildren": false
  }
}
I get a 400  - Cannot convert a primitive value to the expected type 'Edm.Int32'.
 
 
I am able to move the document set with the move function on the SharePoint Library but can't do it with Power Automate.
 
 
  • Michael E. Gernaey Profile Picture
    36,015 Super User 2025 Season 1 on 14 Mar 2025 at 17:56:30
    How to copy or move document sets from one library to another in SharePoint using Power Automate
     
    Are you required to use the Send HTTP request? Can you leverage the actions directly. Now that question isn't whether it works, I am asking if you can change the approach.
     
    also, can you please share your Flow, with inputs (build mode) and then also in Run mode where you get the errors, so we can see the inputs and outputs of each step to hopefully get more details.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Thomas Rice – Community Spotlight

We are honored to recognize Thomas Rice as our March 2025 Community…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,508 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,431 Most Valuable Professional

Leaderboard
Loading complete