SharePoint Designer Workflow Move Document with Rest API

One of the things that are missing in SharePoint Designer is an action to Move a document from one location to another. There are a lot of awesome articles out there to get started with SPD and Rest API’s. I personally had a lot of Fabian Williams his posts. .. Paolo Prialorsi has a WSP with a custom move action:

I wanted it to do with REST to check out the possibilities. Workflows run under the credentials & user permissions of the one who initiates the request. So if we want to run the the workflow using different rights we need to use a App Step. Read more on:

In my case I need to call {currentWebUri}/_api/web/lists/GetById(guid'{ListId}’)/Items({sourceItemID})/File/MoveTo(newUrl='{targetFolder}’,flags=’1′) .

When I translate this to SPD I’ll get:


A REST API Call has also a Request Header. This we need to fill up with the necessary parameters. To see what your parameters need to be, use fiddler to simulate your Rest API Call. I urge you to check Fabian’s blog for detailed information about how to do this. In my case I need one parameter Accept. If I want to provide this to my Rest API Call, I need to add it to a Dictionary.


When we combine these things together we’ve got:


If you move the file/item that this workflow was running on outside it’s document library/list, the workflow will become disassociated. The workflow will keep on being in a running state but it will have no document/item that it can attach to.

2 thoughts on “SharePoint Designer Workflow Move Document with Rest API

Leave a Reply