3

I am trying to create a single document library that links to documents in the same library in SharePoint 2010 Server. I've created a multi-value lookup column that references the same library to allow this behavior.

For simplicity, this document library has 2 fields: Item (text) and RelatedDocs (multiple value lookup). Ultimately, I'd like to have a 2-way relationship between these documents; So if an item is added/deleted in the RelatedDocs column, those documents in that multi-value column would be updated with the current document as well.

Since I have been unsuccessful in automatically updating those documents, I've tried adding a CQWP and DVWP in the Edit and Display forms to display all of the related documents for the specified document. In the CQWP I've added filters: RelatedDocs contains [PageFieldValue: Item] OR Item contains [PageFieldValue: RelatedDocs] but does not break up the multivalue RelatedDocs field.

For example, I have 3 documents: Doc1, Doc2, Doc3. I set Doc1 : RelatedDocs = Doc2 and Doc3. When viewing the details of either Doc2 or Doc3, I see Doc1 in the Related List/CQWP. When viewing the details of Doc1, I do not see Doc2 or Doc3 in the Related List/CQWP unless it is specified in the other items. It would not be manageable to create a link on both sides for every document. Is there any way that I can have the values in the RelatedDocs column appear in the Related List or CQWP?

I'd prefer to use SPD and OOTB functionality. Any suggestions would be appreciated! Thanks!

1

I have met a similar requirement in the past with a term set. Allow users to set keywords on the documents and then show all documents with the keyword in the PageFieldValue. Note that this will only work with multi-value keywords if your CQWP selects from a single library - though you can use a single-value keyword from multiple libraries.

  • Thanks for the reply Dave! So in the example above, change the RelatedDocs field to a multi-value managed metadata field? Then how should the CQWP be filtered? If I filter where RelatedDocs contains [PageFieldValue: RelatedDocs], I end up with more results than desired. The user has some strict linking requirements so that's why I leaned towards the lookup field after trying keywords. – Rob May 21 '13 at 13:50
  • Your filter should work in the same way - assuming only the related docs have the same term applied. Another approach is to stick with your first column and use a workflow to inject into the select documents column. – Dave Paylor May 21 '13 at 20:26
  • The documents could be linked to many different documents. The keywords seem clunky for the user since they want explicit relationships. Is it possible for the workflow to loop/iterate through each of the properties of the selected RelatedDocs and selectively update them with the current document? It seems like a cumbersome process. – Rob May 21 '13 at 20:50
  • Yes, looping through each linked document would be the approach. I agree, it does feel a bit clunky but if you do not like the term set method then I cannot think of another way. Good luck. – Dave Paylor May 21 '13 at 21:09
0

Interesting challenge so here is how I would solve it. (I built this in SharePoint 2013 but used a 2010 workflow so hopefully it works for you)

Summary: Add the "Predecessors" column to the document library and use a workflow to automatically update the "Item Title" filed when documents are added to the library. The Predecessors column points to the library it is a part of and looks at the "Item Title" column by default. This way you can modify the properties of each document to establish related documents as you see fit.

  1. Create Document Library
  2. Library Settings > Advanced Settings > Content Types (Yes)
  3. Open the "Document" content type and choose the group called "Core Task and Issue Columns" and choose "Predecessors" add it.

Now if you fill in the "Item Title" field you can see how it works. (Feel free to rename it to "related files" if need be

Automating the "Item Title" to reflect the Document "Name" can be done by making a SharePoint designer workflow.

Logic: (2010 workflow)
(step 1)
#(update if empty)
IF [Current Item:Item Title] is empty
 Update item in [current item]
  (Add Value Assignment) Set "current item:Item Title" to "current item:Name"
#(update if changed)
Else [Current Item:Item Title] is not empty
 Update item in [current item]
  (Add Value Assignment) Set "Current item:Item Title" to "current item:Name"

end workflow

enter image description here

one last note is that the "Item Title" column isn't required and leave it that way, you may want to add a description to that field saying something like "A workflow will update this from the document name automatically" or something like that.

The end result you can show the predecessors column in your views and edit the document properties to let users associate documents with each other. Everything automatically updates and syncs if users change file names etc.

enter image description here

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.