cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PowerTegga
Helper I
Helper I

Copy and Move Document sets using REST (CreateCopyJobs) fails: Bad gateway error.

Hi.

 

I'm having problems moving/copy a document set from one SP document library to another on same site. I've tried using this method, but I can't make it work:

https://www.cloudappie.nl/powerautomate-copydocset-rest/

 

My understanding is that I don't need to create a document set folder in the flow because it willl be copied?

 

I get this error anyway that says that it cant find the files in the target document library.

 

Here is the flow I've set up:

 

CopyDocSet.png

 

And here is the error:CopyDocSetError.png

 

2 ACCEPTED SOLUTIONS

Accepted Solutions

Thanks for all your replies.

 

I found out what was the problem:

 

The copy of the documentset with all its underlying files actually worked, but it also tried to copy each of the underlying files after that, with the same path as the documentset, not the path to the document, hence the error messages.

 

I've change the "Get files (properties only)" to "Get items" and chose "No" on "Include Nested Items", and I also change from "isMoveMode: false" to "true", and it moves the documentset with all its files and folders in one operation 🙂


View solution in original post

4 REPLIES 4
manuelstgomes
Super User II
Super User II

Hi @PowerTegga 

 

The issue is in the get file properties. You need to get the file contents to be able to save it on the other SharePoint site. 

 

But it's much more simple to use the SharePoint's Copy File. 

Screenshot 2020-08-13 at 10.17.27.png

 

Have you tried it? 

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

v-litu-msft
Community Support
Community Support

Hi @PowerTegga,

 

It says that the target location is invalid, it seems that there has an additional "/" at the end of destinationURL, so please remove it and try it again:

Annotation 2020-08-14 094957.jpg

 

And there is a blog introduced the api, you could refer to it:

https://blog.velingeorgiev.com/createcopyjobs-api-copy-move-SharePoint-files-folders

 

There is my test case:

Annotation 2020-08-14 094956.jpg

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks for all your replies.

 

I found out what was the problem:

 

The copy of the documentset with all its underlying files actually worked, but it also tried to copy each of the underlying files after that, with the same path as the documentset, not the path to the document, hence the error messages.

 

I've change the "Get files (properties only)" to "Get items" and chose "No" on "Include Nested Items", and I also change from "isMoveMode: false" to "true", and it moves the documentset with all its files and folders in one operation 🙂


View solution in original post

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Users online (31,355)