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
Community Champion
Community Champion

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
 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

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

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (3,183)