Show form version in Infopath with XPath

‘What form version do you use?’
‘Is this the most recently updated InfoPath form?’

Usually you get those particular questions from your endusers who are using InfoPath forms. Sometimes it appears that if you modified a formtemplate, the ‘update & save’ option in the Filler doesn’t become available. Therefore it can be very useful to display the template-version in your form. It helps you quickly determine a version issue and saves little troubleshooting time.
There are two different types of document/template versions:

– The formtemplate version number
– The uploaded form version number (versioning in SharePoint must be enabled)

Since versioning in SharePoint makes it easy to determine what version you’re using, I’ll only explain the template versioning.

To display the template version you simply choose the ‘Calculated Value’ field. Drag it in to a place were it makes sense:

01 The Calculated Value Field:

 01 Calculated Value

02 Size it, edit its properties and add the right Xpath formula:

02 Xpath Formula

substring-before( substring-after( /processing-instruction()[local-name(.) = "mso-infoPathSolution"], 'solutionVersion="'), '"')

03 Now apply this formula and look to at final result:

03 Version Result

Now it shows the template-version in which you are working.
Determine in your InfoPath Designer which version must be used and this will also give you the possibility to add a changelog to it!

Just an ordinary Microsoftdude...

Tagged with: , ,
Posted in Customize, InfoPath, SharePoint
One comment on “Show form version in Infopath with XPath
  1. […] Show formversion in Infopath with XPath ( […]

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Blog Authors

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 443 other followers

Blog Stats
  • 3,548,393 hits
  • An error has occurred; the feed is probably down. Try again later.
  • An error has occurred; the feed is probably down. Try again later.
%d bloggers like this: