Is there a way to show the document status inside a document library indicating if the document is Draft or Published

sharepoint.stackexchange https://sharepoint.stackexchange.com/questions/231016

Domanda

I have a SharePoint enterprise farm 2013 on-premises. and i have a team site which contain a document library. now for this document i define the following versioning settings:-

enter image description here

so currently my document can have a minor version with fraction (1.2, 2.5, etc..) OR major version. and when the document have a minor version i can chose to "Publish a major version". but my question is how i can define a status column inside my document library which will show if the document have "Draft" status when it have a minor version OR if the document have "Publish" status when it have a major version? is this possible? i need something similar to the "Approval Status" field which will be automatically presented when i set the document library to "Require content approval for submitted items"..

È stato utile?

Soluzione

I'd probably set up a calculated column that looks at the Version. Basically this finds the version, finds the decimal point and if the number after the decimal point is a 0, it's published, otherwise, it's a draft. I haven't tested this in SharePoint, but only in Excel and it worked.

=IF(RIGHT([Version], FIND(".",[Version])-1)="0", "Published", "Draft")

EDIT: Ack, it's one of the columns that gets updated afterwards. You may need to set a simple workflow to capture "Draft" or "Published" - See here

Create a new column called "Draft/Published" where the default value is "Draft". Have a workflow that triggers on Item Modified in which the logic looks something like:

Pause for 1 minute
Find '.' in Version (Output to Variable: index)
Copy from Version, starting at index (Output to Variable: substring)
If substring equals 0 
   Set DraftStatus to "Published"
Else
   Set DraftStats to "Draft"
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a sharepoint.stackexchange
scroll top