A colleague of mine (Thank you Iain!) posed a question to me today of how to remove the links that appear whenever you use a lookup column to another list. Sometimes this behaviour doesn’t make any sense and just confuses the end user. (Microsoft.. please add a tick box when creating lookup fields to remove this!)
My first inclination was to create a Field display template to just display the value, but a quick Bing soon found the solution buried in one of the MSDN forums. An almost as quick test proved that the solution works just nicely in Office 365 so I figured I’d write it up here with some nice pictures for future reference!
So just to be clear, I didn’t come up with this solution, I’m just reposting it here with pictures for the benefit of others!
For the demo, I have a very simple list of names, with a Job Description column which pulls in from an available list of Job Descriptions.
You can see by the colour that the Job Description field is actually a link and if the user hovers over it behaves as you would expect. However clicking on that link serves no purposes at all, it just pops up another modal dialog with the Job Description displayed.
You’ll agree I’m sure that this serves no purpose to the user and ideally we’d like to remove the behaviour. In SharePoint 2007/2010 we could just manipulate the XSLT for the list view and in SharePoint Designer this was a really quick fix. In SharePoint 2013, we could do similar using a Field Rendering Display Template, but that involves a lot more effort than is really necessary. Instead, we just need to configure an additional field for display, and then make a couple of quick edits.
If you go into the list settings and then look at the configuration of our Lookup Column, you can see that I’ve selected the Title column to be displayed, but you can also select Title as one of the additional columns to be displayed. if we go ahead and do that, we now have two fields in the view, JobDescription and JobDescription:Title.
Back in our list settings, you now see JobDescription:Title in the field list. If you click on that version of the JobDescription column, you’ll see that you can edit the display name of the field, which we can now rename to Job Description.
Once that’s done, we then edit our current view and remove the JobDescription field and leave the old JobDescription:Title field which is now displayed as Job Description WITHOUT the clickable URL behaviour.
There’s a couple of little gotchas though, You can’t rename the additional column to a reserved or existing field name, which is why you’ll see that I added the original JobDescription field without a space (Which of course you should all be doing anyway to avoid Internal Name Pain!)
I hope this helps you.
Paul.
3 comments
I never understood the pupose of this link either. Thanks for Sharing!.
Cool tip, keeps the UI a bit cleaner.
The link can be useful if users want to edit the item. However there are multiple ways to get to the edit view.
Author
I agree, there are times when you do want to click through and in those cases having an active link absolutely makes sense, but a lot of the cases that I come across it doesn’t and just confuses the users. Generally the people managing the lookup lists know where the source list is and manage it there.