Introduction
Recently we implemented a SharePoint based solution for a Postal and Parcel company based out of Melbourne, Victoria, Australia. We worked with multiple SharePoint document libraries for our project. Once we came across a scenario when we upload a document, then the document's metadata gets auto-populated or it becomes blank for some specific scenarios and document types.
In this blog, we will learn about this issue, why it gets blank for some specific scenarios and document types, and also we will understand the relationship between the issue and the Document Property Promotion and Demotion feature associated with the document library.
Recently we implemented a SharePoint based solution for a Postal and Parcel company based out of Melbourne, Victoria, Australia. We worked with multiple SharePoint document libraries for our project. Once we came across a scenario when we upload a document, then the document's metadata gets auto-populated or it becomes blank for some specific scenarios and document types.
In this blog, we will learn about this issue, why it gets blank for some specific scenarios and document types, and also we will understand the relationship between the issue and the Document Property Promotion and Demotion feature associated with the document library.
Issue
- When we upload a new document to the SharePoint document library the metadata properties get selected automatically which was not the expected behavior for the document library.
- When we upload an existing document, it was overwriting some of the properties and was clearing out the values for some of the properties.
- We wanted an experience to be like when the user uploads a new document it should have blank values for its properties. And, if the user uploads an existing document the document should maintain its properties.
Solution
- To resolve this issue, we tested the upload process with different document types like docx, xlsx, .pptx, .pdf, .jpg, .png etc.
- We faced this issue with office documents only like Word Documents, Excel Files, etc.
- We came to know that SharePoint provides a feature called Document Properties Promotion and Demotion.
- This feature is responsible for auto-setting the document’s properties when we upload the document to the document library.
- If we create a new document, it won't have any metadata associated with it.
- And, if we download an existing MS Office document from a SharePoint Document Library that document will be downloaded with its metadata properties and when we upload the same document to a document library then its metadata will get overwritten for that item after the document gets uploaded successfully.
- To resolve this issue, we can erase the metadata associated with the document before uploading it to the document library as shown below.
Step 1:
- By performing the above steps, we can remove the metadata values associated with the document.
- The Document Property Promotion and Demotion feature causes this behavior of copying and storing the document's metadata while downloading it. And overwriting its metadata while uploading that same document again in the library.
- We can disable the Document Property Promotion and Demotion feature for SharePoint on-premises but we can't disable this feature for SharePoint Online.
- But, This feature is very useful apart from this issue. For example, when we copy the file from one document library to another document library and if the destination library contains similar columns, it will copy-paste the document metadata automatically. We won't need to update it manually.