I have a SharePoint site collection with both the Document Set and Document Id features enabled. I then have a document library where I've created multiple document sets, each with one or more documents. Lastly, I have a page that displays a flattened list of all the documents.

Is it possible to get the Document ID (aka Parent Id) of the document (child) in this view? I want create a link back to the Document Set Welcome Page for the parent document set rather than the default link directly to the document. Can I somehow create a look up column in the view that would pull back the parent Document ID?

Document ID's seem like the best way to make this happen but I'm open to other suggestions.

2 Answers 2


Document Sets basically are a specialized version of a standard folder.

You should be able to reference the container document set by first getting the reference to the container folder (doc sets doesn't support sub-folders, so the first parent folder for the file should be the document set) and then using the static DocumentSet.GetDocumentSet Method to obtain the document set instance.


SPFolder docSetFolder = targetSPFile.ParentFolder;
DocumentSet docSet = DocumentSet.GetDocumentSet(docSetFolder);

Could this work for you or there was any special need for using the document id?

  • No special need for the document id. The goal is just to be able to link to the document set welcome page. Jul 27, 2012 at 16:08

I was able to do this by using a workflow that copies the Doc ID to a text column if the content type is a doc set, then adds it to a variable, then copies to yet another column. From there, I share that column in the doc set settings so that any documents added to a doc set get the value (the doc ID from the document set).

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.