{"id":1470,"date":"2021-02-22T11:44:54","date_gmt":"2021-02-22T06:14:54","guid":{"rendered":"https:\/\/blog.binarybits.net\/?p=1470"},"modified":"2021-05-03T16:19:31","modified_gmt":"2021-05-03T10:49:31","slug":"hide-json-column-formatting-for-folder-content-type-in-sharepoint-online","status":"publish","type":"post","link":"https:\/\/blog.binarybits.net\/hide-json-column-formatting-for-folder-content-type-in-sharepoint-online\/","title":{"rendered":"Hide JSON column formatting for folder content type in SharePoint Online"},"content":{"rendered":"\n
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.<\/p>\n\n\n\n
Following is a simple JSON which can help.<\/p>\n\n\n\n
{\n "$schema": "https:\/\/developer.microsoft.com\/json-schemas\/sp\/column-formatting.schema.json",\n "elmType": "a",\n "txtContent": "Navigate to home page",\n "style": {\n "cursor": "pointer",\n "visibility": "=if(((indexOf([$ContentTypeId],'0x0120')) == 0),'hidden', 'visible')"\n },\n "attributes": {\n "target": "_self",\n "href": "= @currentWeb"\n }\n}<\/pre><\/div>\n\n\n\n