Forum Discussion

Sandie Fry's avatar
Sandie Fry
Copper Contributor
Aug 05, 2020
Solved

SharePoint List - Conditional Formatting - Links

I'm using Conditional Formatting to turn a URL into a friendlier looking link, but I don't seem to be able to style it at all.  I'm pretty new to this conditional formatting thing, so this is more of...
  • Sandie Fry's avatar
    Aug 06, 2020

    So it looks like I was just putting the Styling in the wrong place, I thought it had to go in "attributes"

     

     

    // AEM6 Production
    {
      "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
      "elmType": "a",
      "style": {
        "text-decoration": "none",
        "font-size": "24px"
      },
      "txtContent": "",
      "attributes": {
        "iconName": "=if(@currentField == '0', '', 'Design')",
        "target": "_blank",
        "title": "AEM6 Production",
        "class": "ms-fontColor-themeDark",
        "href": "@currentField"
      }
    }

     

Resources