Posted by : Alon Havivi Friday, March 06, 2015


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:

31 Responses so far.

  1. Thanks this works like a charme!

  2. 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

  3. 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

  4. 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

  5. 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?

  6. 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


  7. 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

  8. 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



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

  10. 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

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

  12. 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

  13. 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

  14. 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

  15. 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


  16. 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

  17. 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

  18. 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
    `


  19. 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

  20. 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

  21. 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

  22. 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

  23. 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

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

  25. 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

  26. 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

  27. 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

  28. 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


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

Popular Post

- Copyright © Alon Havivi's Blog -