Working in SP13. Is there a way to assign metadata if a document is moved into a folder in a document library?

I already have folders with documents inside. If a user uploads a new document to the library, I want them to choose the particular folder the document should go into. The key is to have metadata assigned.

After research the only way this can be done in SP is by creating a content type. However, should this be a document content type or a folder content type? If so, how would this be done in SP2013? All information found is for SP10. The basic should remain the same: 1. Go to Site Content Types 2. Click create 3. Not sure whether the content type should be document or folder .... not sure after this.

Can anyone help me? I am not sure if I am headed into the right direction. Also, SP13 could have an easier way to added metadata to folders without script...etc. Thanks for your help.


You could achieve this by using the Document Set infrastructure.

SharePoint 2010 introduced a new type of document container to be used in place of the standard folder called Document Set. As per Microsoft documentation:

A Document Set is a group of related documents that can be created in one step and then managed as a single entity.... (You can) specify any shared metadata that you want synchronized to all documents in a set.

Let me explain. A document set is "a special type of folder" with some extra features attached to it. Documents inside a set can share some common metadata. The basic idea is that the Document Set defines some metadata field and those field are automatically synched to all documents you create inside the set. That should be enough for fulfilling your purpose.

There is one thing to consider though. The metadata are kept in synch via a timer job, so there may be times when the job has not yet run and you may still view old data. If this could be a problem, perhaps you should resort to something different instead (a custom action that runs the job? an event receiver that emulate it? it depends on your actual environment).

--EDIT-- Some clarification about Document Set.

As you may have read from the linked documentation, when you define a document set you can specify:

  • a set of associated content type: this would de-facto restrict the available content types you can chose when creating a new document or uploading an existing one to the set (notice that it would still be possible to bypass this restriction by abusing some object model "bugs"). Basically, under normal circumstances, you can ensure that the set only contains document of a specific range of types.

  • some document that should be used as default content when a new set is created in the library. This way you can have some standard document be automagically created for each new set.

  • a set of some columns whose values will be kept in synch between the set and the contained documents. This actually means that those field will be no longer directly editable on the document: you will need to edit the SET and then the data will be copied to all the document via a timerjob.

AFAIK, none of the above is required for creating a set (unless I am wrong and you need at least one shared column), so you could just ignore the first two point and work with the third.

  • Thanks, @SPArchaeologist for your response. Correct me if I am wrong, but with a document set doesn't the documents need to be templates? The documents are not always related, therefore, I thought a folder content type and a document content type would work. Am I missing something? Thank you for your help. – SharePoint Lady Feb 11 '14 at 16:52
  • @SharePointLady - nope, when you create a document set you can define a set of associated content types and default content, but you aren't required to do so. At the minimum, a document set is just a folder that synch some of its metadata with the contained documents. I will edit the answer to try to be more clear. Anyway... you say that the document are not always related... but why? If they share the common metadata, that would mean that a logical relation does exist - no need for any more elaborate relation. – BlueSoul Feb 12 '14 at 9:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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