Json code not working

Copper Contributor

I want on my column to show SDS not the link i used the json code below but still not working

 

{

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

   "elmType": "span",

   "txtContent": "[$SDS]",

   "attributes": {

      "target": "_blank",

      "href": "@currentField"

   }

}

1 Reply
I had also tried this code but still not working
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"children": [
{
"elmType": "span",
"txtContent": "NA",
"style": {
"display": "=if(@currentField, 'none', 'block')"
}
},
{
"elmType": "a",
"attributes": {
"href": "@currentField",
"target": "_blank"
},
"txtContent": "SDS",
"style": {
"display": "=if(@currentField, 'block', 'none')"
}
}
]
}