Hide JSON column formatting for folder content type in SharePoint Online
In SharePoint online, sometimes we need to hide the JSON Column formatting.
For this a visibility condition can be added based on the folder content type.
Following is a simple JSON which can help.
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
"elmType": "a",
"txtContent": "Navigate to home page",
"style": {
"cursor": "pointer",
"visibility": "=if(((indexOf([$ContentTypeId],'0x0120')) == 0),'hidden', 'visible')"
},
"attributes": {
"target": "_self",
"href": "= @currentWeb"
}
}