Publish as major version SharePoint file with workflow 2013 REST API


SharePoint 2013 workflows has out of the box workflow actions Check In and Check Out


But does not have any actions for check in as Major version (publish)
To solve this, we can  use the "call http web service" action with SharePoint REST API.

Follow these steps to check in a File as major version (publish):

1. Create a Workflow 2013 in SharePoint Designer

2. Rename the Stage to "Published"
3. Add a Build Dictionary action and name the output variable "JSonRequestHeader". Add a string variable named content-type with the value application/json;odata=verbose and add a new string variable named Accept with the value application/json;odata=verbose and click OK

4. Add a new Build Dictionary action and name the output variable "JSonRequestParameters"
    Add a string variable named comment with the value Published by workflow


5. Check Out the file

6. Add Call http web service action with these properties:

Address
[%Workflow Context:Current Site URL%]/_api/web/getfilebyserverrelativeurl('[%Current Item:Server Relative URL%]')/CheckIn(comment='Published by workflow',checkintype=1)

RequestType: Post

RequestHeaders: Variable: JSonRequestHeader

RequestContent: Variable: JSonRequestParameters

ResponseContent: Variable: JSonResult (Create new)

ResponseHeaders: Variable: JSonResponseHeaders (Create new)

ResponseStatusCode: Variable: responseCode

7. Then publish your workflow

The final result:

Previous
Next Post »
215 Komentar
«Oldest   ‹Older   201 – 215 of 215   Newer›   Newest»
avatar

good blog articles, I really like, nice post. thank you for sharing.
cara daftar togel
cara deposit

Balas
avatar

Nice Post, I really enjoy reading the articles that are made, thank you.
cara bermain togel online
cara daftar togel online

Balas
avatar

very helpful reading your blog articles, thank you very much in advance.
cara penarikan togel
cara withdraw togel

Balas
avatar


Thanks for the article, good information so nice.

PRTOTO

Balas
avatar

https://www.blogger.com/comment.g?blogID=3173848626557641342&postID=370162742216880768&page=1&token=1708358916257

Balas
avatar


A very insghtful article, really love it. PRTOTO

Balas
avatar

Lovely article who inspired me a lot.
PRTOTO

Balas
avatar

When I read your article, I realize it is really insipired me to write my blog as good as yours
PRTOTO

Balas
avatar

A good writing and help me so much and I also get personal experience during reading your blog
PRTOTO

Balas
avatar

A very good blog with very good content, always looking for your new content. Keep up the good work...PRTOTO

Balas
avatar

Amazing content, eager to have your new post.PRTOTO

Balas
avatar

A wonderful writting content. Really love your work...PRTOTO

Balas
avatar


I'm really enjoy to read your wonderful writing, really believe you could do other writting as good as this or even better. PRTOTO

Balas
«Oldest   ‹Older   201 – 215 of 215   Newer›   Newest»