Sep 27 2016 07:40 AM - edited Sep 27 2016 07:47 AM
Hello community,
I am using SharePoint REST API in SharePoint (Online) 2013 Workflow to move documents b/w different libraries. It was working fine for files with small names but it failed for documents with very large names.
For REST API we have to pass server relative URL in the moveTo method so it fails if my destination library structure contains nested folders and server relative URL becomes very lengthy.
1) Is there a work around for this URL limitation (260 characters)
1) Can i use "GetFileByID" or "GetFolderByID" to move documents using REST API?
Help needed!
Sep 27 2016 10:27 PM - edited Sep 27 2016 10:29 PM
Hi Bilal,
If i am correct you can get the docid and use that one. Only on the move you have to get the stream to put it in the new library.
hope it helps.
Paul
Feb 28 2017 12:11 PM
Resurrecting this instead of posting a new one. I've just come upon this same issue. Is there no way to work around this?
This is a url for a POST that is 296 characters long (and SUCCEEDS) (259 char excluding the tenant) - replaced with b's, x's, and y's to protect the innocent, but the following depicts exact length
https://bbbbbbbbbbbbbb.sharepoint.com/sites/customer/plan/_api/web/lists/getbyid('34b6672e-531e-443e-86a8-eeb17eb9259f')/items(172)/file/moveto(newurl='/sites/xxxxxxxx/yyyy/151/bbb bbbbb bbbbbbb bb (bb) bbbb/bb bbbbbbb bbb bbbbbbbb Reports/Service Reports 2015/2015 Sample Doc Five.docx',flags=1)
This is a url for a POST that is 298 characters long (and FAILS) (261 char excluding the tenant)
https://bbbbbbbbbbbbbb.sharepoint.com/sites/customer/plan/_api/web/lists/getbyid('34b6672e-531e-443e-86a8-eeb17eb9259f')/items(172)/file/moveto(newurl='/sites/customer/plan/151/bbb bbbbb bbbbbbb bb (bb) bbbb/bb bbbbbbb bbb bbbbbbbb Reports/Service Reports 2015/201501 Sample Doc Five.docx',flags=1)
There is no way at all to perform this file move using REST?
Mar 24 2017 08:56 AM
SolutionHi Brent
You can put the newUrl variable in a Dictionary.
The assign the Dictionary as the parmeters of the Call HTTP web service action.
The POST method will include it as payload.
then Build {...} Dictionary (Output to Variable: parameters)
The pass the Dictionary to the Call HTTP web Service action...
The Call [My Site/MyList/MyItem etc.]/file/MoveTo() HTTP web service with Variable:parameters (Response Content to.....
Hope this helps,
Tony
Oct 31 2017 03:11 AM
Sep 19 2018 07:55 AM
Hi, I know its been a while but could you elaborate a little more on the resolution. I have run into the same issue using SharePoint 2013 designer workflow. A screen shot would help.
Thanks