SharePoint Online - calculated column no longer showing as hyperlink

Copper Contributor

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 all the site name details.

="<a href='site_url_here/SitePages/DesignReview.aspx?Q1="&Title&"'>"&Title&"</a>"

I used a calculated column and set the data returned from the formula to Number.

 

Previously, it would show the Title column as a hyperlink to page that had a query parameter applied.  Now it shows as below (again url removed):

<a href='/site_url_here/SitePages/DesignReview.aspx?Q1=Non-DPK related'>Non-DPK related</a>

 

Has anything change recently in SharePoint Online that is causing this to occur?

 

 
15 Replies

Yes, unfortunatelly MS has done it again: https://support.microsoft.com/en-us/help/4032106/handling-html-markup-in-sharepoint-calculated-field...

 

The change has rolled out the same day the news about it was published :(

 

Although there should be a possibility to request an extension through September 10, 2017. I have no ide how to request it... :D

Here also a load of sites broken without any communication up front, hopefully Microsoft is going to roll-back this change.

I personally do not think that this change will be rolled back. I turned to MS support and asked for extension to keep using html in calculated columns. They reponded by phone in an hour and it was really surprising :)

 

But I'm still waiting (4-5h) for the roll-back :D

Jupp, this is totally frustrating. We are using calculated columns to buil useful links and now they are broken. 

 

I find it strange that MS did this change so fast with minimal warning. I would guess a lot of people use custom markup in calculated fields. 

 

So what if it's not supported, it is highly used so insted of blocking it, they should work on a cool solution to replace it and suprise us insted :) 

This is crazy. I'll have to create JS link templates for a whole bunch of lists if they don't rollback. Are Microsoft going to pay me for this? wtf

The death of the regular "Pro" user and the requirement of being a legit developer continues....

Still no response to our support call while this is a blocking issue for us, many of our sites are broken. No idea what they are thinking. 

We are also facing the same issue.The formula column is displaying plaintext value instead of hyperlink HTML. This was working till tuesday but from yesterday it has suddenly changed. We are working on Office 365 Sharepoint online site. Does any updates implemented by microsoft?

Using js-link to fix the problem. No need to change the calculated field. Here's what I came up with: 

 

function RenderMyCalculatedField() {
var template = {
renderMyField: function (ctx) {
var html = [];
html.push(ctx.CurrentItem.Skicka); // Fieldname 'Skicka'
return html.join('');
}
}
function registerTemplate() {
var context:any = {};
context.Templates = {};
context.Templates.Fields = {'Skicka':{'View': template.renderMyField}}; // Fieldname 'Skicka'
SPClientTemplates.TemplateManager.RegisterTemplateOverrides(context);
}
registerTemplate();
};
RenderMyCalculatedField();

You 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;
}

thank you Vishal!  I managed to get this one working.

Here is the official fix, at least for on-premise:

 

# NOTE:  =$False  NOT  ="$False"
# In SharePoint 2016 Management Shell, run...

$Web = Get-SPWebApplication http://weburl
$Val=$Web.CustomMarkupInCalculatedFieldDisabled=$False
$web.update()

# To confirm it is now false...

$Web.CustomMarkupInCalculatedFieldDisabled

I love OnPremise! There are so many configurations where I need Powershell, and here *tada* another good example. Thank you very much. This Option Needs to be set to false (CustomMarkupInCalculatedFieldDisabled) now the Hyperlink calculated columns work perfectly again (with datatype number).

I used the following script:

cls

Add-PSSnapin Microsoft.SharePoint.Powershell

$Web = Get-SPWebApplication https://intranet... #Your Intranet URL

$Web.CustomMarkupInCalculatedFieldDisabled=$False

$web.update()

@Kelly Dungate with SharePoint online or SharePoint 2019 is not needed because you can format a column as following:

{
"$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
"elmType": "a",
"txtContent": "@currentField",
"attributes": {
"target": "_blank",
"href": "=@currentField"
}
}