The problem

I have a document library with versioning, and I am tweaking the view through the UI.

It appears that, right ootb, when we sort by Version it doesn't really sort properly, as it appears to consider "11" like a string and not like the interger 11.

Sounds overkill if I am to create a new, calculated column just for this.

From the query string, I can see that the field being sorted is _UIVersionString so I guess I shouldn't be surprised.


Anyone else experienced this and has any tips?

Similar threads

Sort order issue

How can I add the UIVersion (integer) field to a view?


version ordering


I might just be able to update the view through CSOM to make it use "UI Version" field instead of "Version" (Title Name)

enter image description here


1 Answer 1


Much to my dissatisfaction, the cleanliest solution I could find was to create a new calculated column, retrieving the integer value of the Version field.

Create a new calculated column using the formula



enter image description here

Apparently, the Version field - also known by it's StaticName _UIVersionString - is of type Text/String, therefore cannot be sorted properly.

There is a field _UIVersion that can in fact be used to sort by version perfectly, however the contents of this field are in a different format, as shown below (something like 512 for each major version). These hidden fields can be added by tweaking the view with CSOM for example.

enter image description here

A quick "workaround" for getting this (manually) would be to replace _UIVersionString in the URL by _UIVersion and use Asc or Desc for sorting order.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.