I'm workingwith Nintex workflow for SharePoint and I need to be able to count the number of decimal places in a document's version value and save that to a variable. IOW, sometimes, with SharePoint versioning, a document can have a version number of 10.1, or 10.12, or 10.123, etc. The value of the version is set in the field "Version", so I can get the value, but then I need to be able to count the number of spaces, for example 10.1 has 1 space, 10.12 has 2 spaces, 10.123 has 3 spaces, etc.
Has anyone else ever done this? If so please provide guidance and examples.
As with any solution there are many ways to acheive the same outcome.
I have attached two workflows to acheive this solution.
The first uses ar regular expression to split the value at the decimal point and stores the values in a collection variable. A collection operation extracts the second index and puts that into a build string action that counts the characters.
The second method is similar but uses 1 less action.
The second method uses the regular expression action to look for everything upto and including the decimal point and replaces it with blank text. The output is fed into a build string to count the characters.