cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

How to tell if someone is checking in a major or minor version of an item in a document library?

Hi Community,

I'm stumped....I need to update a field on a page based on the value of another field in the page.  Specifically I'm working in the Pages Library of a publishing site and the library is set up to require check out (no content approval required). 

The below workflow works well to hijack the check in process and update the field in question.  The problem is I only want it to run if the user is publishing or checking in a major version of the page.  Currently it will hijack the check in process for any document that meets my Run if criteria.

Does anyone have any good suggestions on the best way to determine if a user is checking in a major or minor version?

Thanks in advance

Workflow Details

  • Run if is currently based on content - there are multiple content types in the library and I only care for it run on a specific content type
  • Wait for check out status change - unlocked by document editor (I'm assuming this is similar to QuerySave back in my Lotus Domino development days lol)
  • Check out the item - if I don't do this the workflow fails saying the document must be checked out
  • Commit pending change - because my workflow fits this criteria https://community.nintex.com/docs/DOC-1035
  • Set value of a single field (lookup to another list to get value based on current item value)
  • Check in item - major version

0 Kudos
Reply
2 Replies
Workflow Hero

Re: How to tell if someone is checking in a major or minor version of an item in a document library?

Hi Carla,

you should have an item property called Version..with it, at the start of your workflow, you can check if its value ends with .0 (meaning that's a major version) or not..if not you can end the workflow otherwise you can proceed with what you do..

Just a note..as you have described your workflow, currently if people publish version 1.0, after your workflow has been executed the page will have version 2.0 (because the workflow publish the page as major version again), is it ok? 

An additional thing you have to check if that doesn't create a loop (user publishes a major version, wf starts and publishes a major version.. does it trigger the workflow again?), if it creates it, you have to add some logic to avoid it, maybe a yes/no field that changes value between minor and major version, updated by workflow itself, and let the publish logic start based on version value and yes/no field.

Cheers

Giacomo

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: How to tell if someone is checking in a major or minor version of an item in a document library?

Hi Giacomo!

Seems I tried something along this line where I tried to capture the version as the first and last step of the workflow but version # was the same leading me to think that the version didn't actually change until after the workflow ran completely.

However because I spent so much time on trying to get this to work, I'm going to revisit with a clear head  also I'm armed with a lot more information that I was when I started.

Thanks for taking the time out to respond!


Carla

0 Kudos
Accept as Solution Reply