Follow Us:
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.
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.
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
Step 1. Save the following Code as a 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.
Step 3. Add the link to your JavaScript
Step 4. Add the HTML to the column and select "Number."
Step 1. Edit "Column settings" and select "format this column."
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" } }
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.
The complementary paper includes over 12 years of research, recent survey results, and CRM turnaround success stories.
Request Download
This 60-second assessment is designed to evaluate your organization's collaboration readiness.
Learn how you rank compared to organizations typically in years 1 to 5 of implementation - and which areas to focus on to improve.
This is a sandbox solution which can be activated per site collection to allow you to easily collect feedback from users into a custom Feedback list.
Whether you are upgrading to SharePoint Online, 2010, 2013 or the latest 2016, this checklist contains everything you need to know for a successful transition.