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"
    }
}
Hide JSON column formatting for folder content type in SharePoint Online

Leave a Reply

Your email address will not be published / Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.