Forum Discussion
Kundanm1
May 03, 2023Copper Contributor
Json code not working
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"
}
}
- Kundanm1Copper ContributorI 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')"
}
}
]
}