As of today, some systems are still experiencing issues with HTML markup functionality on calculated columns. Depending upon your environment, there are a couple of different solutions.  

In this blog, we aim to combine various solutions for a one-stop-shop for those who may be experiencing this problem.


Solutions to HTML Markup Functionality

First, here is a little background on why this issue is occurring. 

In short, Microsoft removed the HTML markup functionality because it was an "undocumented use of the feature." With the release of the June 2017 PU HTML markup, Microsoft ended its functionality. 

The HTML markup issue is a pretty straightforward fix, so let's get into the solutions below for different environments.

2016/19 On-Prem PowerShell

Step 1. Open Sharepoint Management Shell as an Administrator.

Step 2. Execute the script below. Please be sure to change the URL to your SP WebApplication.

# SharePoint 2016/19 Management Shell
# Replace App URL with your URL
$WebApp = Get-SPWebApplication http://weburl
$CMCFDVal=$Web.CustomMarkupInCalculatedFieldDisabled=$False
$webApp.update()
$WebApp.CustomMarkupInCalculatedFieldDisabled

 

On-Prem Sharepoint 2013: JavaScript via the JSLink

Step 1. Save the following Code as file.js

JavaScript

(function ()

var fieldCtx = {};

    fieldCtx.Templates = {};

    fieldCtx.Templates.Fields = {

        "ColumnName": //This is field name for the internal column name

        {

            "View": ViewName //Enter the function

        }

    };

SPClientTemplates.TemplateManager.RegisterTemplateOverrides(fieldCtx);

})();

function MakeTicketTemplate(ctx) {

    var columnValue = ctx.CurrentItem.ColumnName;

    return columnValue;

}

Step 2. Upload the script to the SharePoint style or asset library.

Step 3.  Edit web part properties.

  JSLINKIMAGE

Step 3.  Add the link to your JavaScript

JlinkwithURL

Step 4.  Add the HTML to the column and select "Number."

image

Sharepoint Online JSON

Step 1.  Edit "Column settings" and select "format this column."

JSONCOlumnFormat

Step 2. Paste the snippet below.

 

Insert Image

{

"$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",

"elmType": "a",

"txtContent": "@currentField",

"attributes": {

"target": "_blank",

"href": "=@currentField"

}

}


JasonImage

Step 3. Click "Save."

If you have further questions about SharePoint or Microsoft solutions in general, contact our team C5 Insight on the website or call us at 704-895-2500.