Forum Discussion
Kelly Dungate
Jun 14, 2017Copper Contributor
SharePoint Online - calculated column no longer showing as hyperlink
A couple of months back I created a calculated column that was showing a hyperlink and I have just noticed that the calculation no longer works. The formula I used is below, note: I have removed ...
Chris McNulty
Jun 15, 2017Silver Contributor
Please see our update at https://techcommunity.microsoft.com/t5/SharePoint/Custom-markup-in-SharePoint-calculated-columns/m-p/78225
Thanks.
Deleted
Jun 16, 2017You can use following code in JS Link to fix this issue:
(function () {
var priorityFiledContext = {};
priorityFiledContext.Templates = {};
priorityFiledContext.Templates.Fields = {
'URL': { 'View' : setURL},
};
SPClientTemplates.TemplateManager.RegisterTemplateOverrides(priorityFiledContext);
})();
function setURL(ctx){
var ret="";
if(ctx.CurrentItem["URL"] != "")
{
ret = "<a href=\""+ctx.CurrentItem["URL"]+"\" target=\"_blank\" class=\"lnkURL\">"+ctx.CurrentItem["Title"]+"</a>";
}
return ret;
}
- Kelly DungateJun 18, 2017Copper Contributor
thank you Vishal! I managed to get this one working.