Forum Discussion
Sandie Fry
Aug 05, 2020Copper Contributor
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...
- 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" } }
Sandie Fry
Aug 06, 2020Copper Contributor
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"
}
}