SharePoint 2010 Using Lookup Column to Link Directly to a Document instead of the Properties Page

I will start by saying that this solution isn’t super elegant and if I was looking to do this on a very large scale I would probably look for a different approach. But for the task at hand, it works and is manageable šŸ˜‰ I think it is worth sharing because I imagine others will run into similar scenarios. I encourage you (like I would for all scenarios) to test this approach out to make sure it will work for your intended solution.

Scenario: There is a collection of FAQs that have a lookup to an associated procedure. Users are able to access the procedures from the lookup field, however they are only able to open the properties page (see below). Instead what they would like would be the ability to open the document directly from the FAQ and bypass having to open the document properties page.

Since in 2010 we can have multiple columns associated with the lookup I figured we could just add a link to the document as Since in 2010 we can have multiple columns associated with the lookup I figured we could just add a link to the document as part of the field and then have the link referenced as a column. That scenario falls apart because you can’t reference a rich text or link field as an additional column for a lookup. Instead what we are going to do is to create a column in the document library that will hold the formatted link to the document as a string. We will then go into our FAQ list and add that column as an additional lookup column. We will then add that column to our view, along with the content editor web part that converts text to html (see this blog for more information, as that web part was not developed by me).

  1. Add Column to Library –

  1. Create the workflow to populate this column whenever a new item is added or an item is changed.
    1. Create Workflow

  1. Create String Variable to Hold Value

  1. Set variable to value : <a href="Current Item: Encoded Absolute URL ” target=”_blank”> Current Item: Title

  1. Set list field = variable

  1. Add document to library to test workflow. (note the text is formatted in html so you won’t be able to click the link- we will address that in a future step).

  1. Add lookup column to FAQ list.

  1. Add CEWP to page where the column is displayed so that the html is formatted. This would need to be the last web part on the page. In our example we are adding it to the default display form (as customized in this blog post)
    1. Download the html lite code here:
    2. Add the text from the download to a CEWP.

  1. Ensure that the web part is the last one on the page and that it is set to hidden.

Now, when you view the item from the page you added the CEWP you will be able to directly access the document and bypass the properties page.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s