cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PowerTegga
Advocate I
Advocate 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
Super User

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 🙂


FlowCorrect.png

Helpful resources

Announcements
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

PA Survey Carousel Image.png

We want to hear from you!

If you are a small business ISV/Reseller, share your thoughts with our research team.

Users online (2,922)