0

I am trying to get column formatting using JSON working in my on premise SharePoint 2019 and I just cannot seem to get it working and I am struggling to find documentation for it. From what I have read Excel style JSON isn't supported in SharePoint 2019 but I am still struggling to get any formatting working at all.

The main thing that has lead me down this route is trying to get a basic text column with a URL in it to open in a new tab.

I have tried the following JSON but it doesn't work, no errors it just leaves it as a standard text field:

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

1 Answers1

0

First of all, try using this simple JSON once:

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

If it is showing correct hyperlink in SharePoint list column, make sure your list column contains valid web URL.


Also, make sure you are adding the JSON in column formatting settings and not in view formatting settings.

To open the column formatting pane, open the drop-down menu under a column heading the list view. Under Column Settings, choose Format this column:

enter image description here

Choose your column correctly, add/paste the JSON below and click "Save":

enter image description here

Ganesh Sanap
  • 1,386
  • 1
  • 8
  • 18