SOLVED

How to use Version in a calculated column?

Copper Contributor

 

Hi,

I want to use the version number in a calculated metadata column, however, it doesn’t show up in the list.

I am trying to make a calculated column for the file name in SharePoint Document Library, to Concatenate “Document Number & Title & version & approved date”.

 

I would appreciate if you could help on it.

Thanks,

6 Replies
best response confirmed by NastaraN (Copper Contributor)
Solution

@NastaraN 

 

As per my understanding, In calculated column we can't use OOTB Version column.

But there is one classic feature (Which is still available in SharePoint Online) which you can use i.e. Labels from Information Management Policy. Following are the steps to do so.

 

  • Activate Site Collection Level Feature with Name "Library and Folder Based Retention".

kalpeshvaghela_1-1681371677932.png

 

  • Go to library settings and click on Information Management Policy Settings

kalpeshvaghela_2-1681371717340.png

 

  • Click on Document Content type (If you have multiple content type then you need to configure for each content types)

kalpeshvaghela_3-1681371775293.png

 

  • Check on Enable Labels and Define Label Format (You need to use SharePoint Column's Display Name Here). In below screen shot "Version" and "Title" is default column and "Document Number" is custom column. . After adding Label Format click on Refresh button and then click on OK button.

kalpeshvaghela_4-1681371873718.png

 

 

 

After performing above steps, one column with Label will be created automatically in library and you can add it in view, and SharePoint will calculation it's value based on given Label Form.

 

kalpeshvaghela_5-1681372003333.png

 

Limitation:

  • If you document library does have already uploaded document then it will not apply this label by default. (I am not sure whether it's default behavior or bug in SharePoint). For Existing document if you update it manually then label will be applied.

 


Hope it will helpful to you and if so then Please mark my response as Best Response & Like to help others in this community

 

 

 

Hi @kalpeshvaghela , 

 

Thanks for your reply. I tried to follow the steps, however no column is added to my library.  I  tried to use it for version as an example. 

22.PNG

 

As I understand this method will add the version (or any other column) to the printed file. I am looking to copy it in a separate line, my intention is to use the version in my file name convention and this way I can use it in a calculated column which will be the file name. 

 

Thanks, 

Nastaran

 

@NastaraN 


As it's hidden column you won't see that column in Library Setting but you will able to add this column in View

@kalpeshvaghela 

Thanks for your help, appreciate it!
It works and added as a separate column named Label.
Still I cannot use "label" column which includes my Revision info, for a calculated column.
Also in my file properties , the label shows like below for me.

 

33.PNG

Is there anything that I need to change?

Thanks, 

Nastaran

@NastaraN 


But why you want to use it in calculated column? I think now you don't need calculated column as you can consider this as your calculated column and build label according to your requirement.

I have four separate columns for: Document Number, document Title, Version and Approved Date.
My file naming convention requires all of these columns together, so I want to generate a separate calculated column to concatenate all these 4 columns together. However Version and Approved date are not accessible for calculated column.
I would appreciate it if you can help on resolving it.
Thanks,
1 best response

Accepted Solutions
best response confirmed by NastaraN (Copper Contributor)
Solution

@NastaraN 

 

As per my understanding, In calculated column we can't use OOTB Version column.

But there is one classic feature (Which is still available in SharePoint Online) which you can use i.e. Labels from Information Management Policy. Following are the steps to do so.

 

  • Activate Site Collection Level Feature with Name "Library and Folder Based Retention".

kalpeshvaghela_1-1681371677932.png

 

  • Go to library settings and click on Information Management Policy Settings

kalpeshvaghela_2-1681371717340.png

 

  • Click on Document Content type (If you have multiple content type then you need to configure for each content types)

kalpeshvaghela_3-1681371775293.png

 

  • Check on Enable Labels and Define Label Format (You need to use SharePoint Column's Display Name Here). In below screen shot "Version" and "Title" is default column and "Document Number" is custom column. . After adding Label Format click on Refresh button and then click on OK button.

kalpeshvaghela_4-1681371873718.png

 

 

 

After performing above steps, one column with Label will be created automatically in library and you can add it in view, and SharePoint will calculation it's value based on given Label Form.

 

kalpeshvaghela_5-1681372003333.png

 

Limitation:

  • If you document library does have already uploaded document then it will not apply this label by default. (I am not sure whether it's default behavior or bug in SharePoint). For Existing document if you update it manually then label will be applied.

 


Hope it will helpful to you and if so then Please mark my response as Best Response & Like to help others in this community

 

 

 

View solution in original post