1

Is there a way to approve a document in a document library by using only SharePoint 2013 workflows in SharePoint Designer 2013? This is possible using SharePoint 2010 workflows however these features were removed from SharePoint 2013 workflows (e.g. the Set Content Approval Status and similar actions have been removed. See What's changed in SharePoint Designer 2013).

All solutions that I have found involve creating both a SharePoint 2010 workflow and SharePoint 2013 workflow, and then using "Start a list workflow" within the 2013 workflow to start the 2010 workflow. Given that the 2010 workflows are deprecated, I would rather create new workflows without them (see the solution to How to create your own approval custom workflow in spd 2013?).

I've tried creating a 2013 workflow and then using the "Update list item" action but this doesn't seem to give access to the "Approval Status" of the document library.

What am I missing?

  • Have you configured a Workflow Manager Farm? harbar.net/articles/wfm1.aspx – Benny Skogberg Nov 7 '16 at 18:03
  • Yes, Workflow Manager has been configured. Do I need to configure special permissions to edit Approval Status using a SharePoint 2013 workflow? – Julian Nov 8 '16 at 18:10
  • 1
    The solution seems to be to use the Call HTTP Web Service action to make calls to the SharePoint 2013 REST API. I'll give some feedback once I've had an opportunity to test this method for document approval. – Julian Nov 8 '16 at 22:47
1

It is possible to approve documents using only SharePoint 2013 workflows by using the 'Call HTTP web service' action and then making a call to the SharePoint 2013 REST API (see the File Approve method in the REST API reference on MSDN):

  1. Add action 'Build Dictionary'
  2. Add an item to the dictionary with the following properties:

    Name: 'Accept'
    Type: 'String'
    Value: 'application/json; odata=verbose'
    
  3. Output to 'Variable: header'

  4. Add action 'Call HTTP web service'

  5. Right-click the action and select properties

  6. Set as follows:

    Address: http://server/subsite/_api/web/getfilebyserverrelativeurl('/subsite/Shared Documents/test.docx')/approve('Enter your approval comments here')
    Request Type: HTTP POST
    Request Headers: Variable: header
    

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.