Skip to main content

in order to create a workflow to update title field with name-field value, on a list where check-out is mandatory, I had to do the check-out / check-in rutine, but checking in overwrites the "comments on check-in" field and leaves it empty.

so I found: How to get latest version history comment which, to some extent works fine... it works..BUT:

it is keeping all the latest comments, and the field is growing and growing, it even takes the comments from other fields and adds them also.

 

17243i243F3E425EB1ADF3.png

 

So how do I limit it to ONLY the very last comment?

 

hmm. how to mark as solved by one self?  😀

the call webservice for "versions" is "standard":

the web-URL_with/_vti_bin/Versions.asmx

web method: getversions

filename string :  item URL 

 

store result in:  a text-variable ( single line which I named  "tmp_comment" )

 

then:

Query XML

 

XML-Source:

{WorkflowVariable:tmp_comment}

 

process using: Xpath

//defaultNS:result/@comments

 

store in: a text-variable ( single line which I named "Newcom" )

 

Then:

Check OUT > current..   ( has to be checked out in this list, made mandatory in by me )

 

In between here I actually copies the filename IF is changed to the Title field.

( the strange lack of function i SharePoint, where uploaded files is stored i a "name" field, and "title" left unused, so no one can use it for a lookup field. )

 

Then:

Check IN: 

from: Current

Comments: {WorkflowVariable:newcom}

 

Check in type: Major ( i did not see any change in the version anyway, it kept my "current version" )

 

but, bottom line, I made it work that way.

It copies my comment at check in, stores it, 


Reply