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 »
46 Komentar
avatar

Thanks this works like a charme!

Balas
avatar

Thanks for the informative article. This is one of the best resources I have found in quite some time. Nicely written and great info. I really cannot thank you enough for sharing.
Regards,
Camellia

SEO Training in Chennai

Balas
avatar

Superb i got some valuable tips from here. Really its a amazing article i had ever read. I hope it will help a lot for all. Thank you so much for this amazing posts and please keep update like this excellent article.

Informatica Training

Balas
avatar

your works are really great and innovative it is really amusing and good work too, so please update this kind of information more and thanks for sharing this information.


salesforce training in chennai

Balas
avatar

Hello, Thanks for the information, however when trying to apply I get a bat request message logged into the response code, If i go to the URI and paste it in the browser I get the following message:


-
-1, Microsoft.SharePoint.Client.ClientServiceException
The HTTP method 'GET' cannot be used to access the resource 'CheckIn'. The operation type of the resource is specified as 'Default'. Please use correct HTTP method to invoke the resource.


Do you know what might be causing this?

Balas
avatar

This article creates a new hope and inspiration with in me. Thanks for sharing article like this. The way you have stated everything above is quite awesome. Keep blogging like this. Thanks.

SAP training in Chennai

Balas
avatar


Thanks you for sharing the unique content. you have done a great job. thank you for sharing such a unique content.
SEO Company in Chennai

Balas
avatar

You did a great job.. Thanks a lot for sharing this useful informative post with us.. Keep on blogging like this informative post with us, to develop my career in the right way.

Digital Marketing Company in Chennai

Balas
avatar



Awesome..You have clearly explained …Its very useful for me to know about new things..Keep on blogging..
seo institute in chennai

Balas
avatar

Very nice blogs.We will be learning that the wonderful information.So, i would be like this sites contents.

Informatica Training | Angularjs Training | Tableau Training | Hadoop Training

Balas
avatar

Wonderful article, very useful and well explanation. Your post is extremely incredible. I will refer this to my candidates...
digital marketing company in chennai

Balas
avatar

the blog is very interesting and will be much useful for us. thank you for sharing the blog with us. please keep on updating.
ROI Services in Chennai

Balas
avatar

I keep on reading your blog post.. This was still amazing. Thanks a lot for sharing this unique informative post with us.. I really enjoyed by reading your blog post

Branding Services in Chennai

Balas
avatar

thank you for sharing such a nice and interesting blog with us. hope it might be much useful for us. keep on updating...
ROI Services in Chennai

Balas
avatar

This is really a very good article. Thanks for taking the time to discuss with us, I feel happy about learning this topic. keep sharing your information regularly for my future reference.
ROI Services in Chennai

Balas
avatar


Wow.. Thanks much for sharing.. My friend also recommended you so that i can have a helping hand to make my blog as effective as possible.

Online Training in Chennai

Balas
avatar

Truely a very good article on how to handle the future technology. After reading your post,thanks for taking the time to discuss this, I feel happy about and I love learning more about this topic. keep sharing your information regularly for my future reference. This content creates a new hope and inspiration with in me. Thanks for sharing article like this. The way you have stated everything above is quite awesome. Keep blogging like this. Thanks.
Hadoop training in Chennai

Balas
avatar

thank you for sharing such a nice and interesting blog with us. i have seen that all will say the same thing repeatedly. But in your blog, I had a chance to get some useful and unique information. I would like to suggest your blog in my dude circle. please keep on updates. hope it might be much useful for us. keep on updating...
Software Testing Training
`

Balas
avatar


this blog is really wonderful and awesome and i got more information from your blog it is really awesome too thanks for sharing. thus i need more information from your blog and it is really very much interesting.



Android Training in chennai

Balas
avatar

It is really very excellent,I find all articles was amazing.Awesome way to get exert tips from everyone,not only i like that post all peoples like that post.Because of all given information was wonderful and it's very helpful for me




Android Training in chennai

Balas
avatar

Provides great information about the concept.It helps an individual to gain knowledge on new techniques.Keep on giving this type of information.
SEO Training in Chennai

Balas
avatar

This blog explains the details about changing the ways of doing that business. That is understand well and doing some different process. Provides he best output of others. Thanks for this blog.
Web Designing Training in Chennai

Balas
avatar

I have been following you for a couple of months now but this is my first time commenting on a blog post. Thank you for sharing your knowledge and experience with us. Keep up the good work. Already bookmarked for future reference.
Hadoop Training in Chennai
Hadoop Training
Best Hadoop Training in Chennai
Best Hadoop Training Institute in Chennai

Balas
avatar

very useful information provided in this blog. concepts were explained in a detailed manner. Keep giving these types of information.
SEO training in Chennai

Balas
avatar

I read this content really awesome.You provided another one great article.I hope this information may change my business carrier.I can remember these things whenever taking the decision.

Java J2ee training in chennai

Balas
avatar

Much thanks to you for sharing the data here. Its much useful and truly i got some substantial data. You had posted the stunning article digital marketing company delhi

Balas
avatar

Helpful as always. Every post you write produce a massive value to your readers that is the only reason it is so popular and has great authority.

Base SAS Training in Chennai

Balas
avatar

Wow amazing i saw the article with execution models you had posted. It was such informative. Really its a wonderful article. Thank you for sharing and please keep update like this type of article because i want to learn more relevant to this topic.


Tooth Braces In Chennai

Dental Hospital in Chenna


Balas
avatar

Thanks for giving the information it is useful for me.aws jobs in hyderabad.

Balas
avatar

Finding the time and actual effort to create a superb article like this is great thing. I’ll learn many new stuff right here! Good luck for the next post buddy..
SAS Training in Chennai

Balas
avatar

Nice blog with having good information. It’s very useful for everyone. Thanks and keep posting this type of blog
CCNA jobs in Hyderabad .

Balas
avatar

Really Good blog post.provided a helpful information.I hope that you will post more updates like this.
Digital marketing company in Chennai

Balas
This comment has been removed by the author. - Hapus
avatar

How many of you know about LG G7 News ?

Balas
avatar

Thank you for taking the time and sharing this information with us. It was indeed very helpful and insightful while being straight forward and to the point.
http://www.mcdonaldsgutscheine.net/ | http://www.startlr.com/ | http://www.saludlimpia.com/

Balas
avatar



This information is impressive; I am inspired with your post writing style & how continuously you describe this topic.


Pawn Shop

Pawn Loans

Pawn Shops

Pawn Loan

Pawn Shop near me

Balas
avatar

It’s the best time to make some plans for the future and it is time to be happy. I’ve read this post and if I could I want to suggest you few interesting things or suggestions.You can write next articles referring to this article. I desire to read even more things about it..
Dental Hospital In Chennai
Best Dental Clinic In Chennai
Best Dentists In Chennai

Balas
avatar

It was indeed very helpful and insightful while being straight forward and to the point
AWS Jobs in Hyderabad

Balas