1

I have added the following JSON code to sharepoint to show a button to request document approval, however I want to limit this to only show the button against files not folders using the Boolean IsFolder.

enter image description here

enter image description here

However I am really new to all of this and cannot work out what expressions I need to add to implement this filter.

Any and all help would be great!

1
  • Is IsFolder custom column created by you or SharePoint default property? Mar 29, 2022 at 15:11

1 Answer 1

1

You can hide the button for folders based on Content Type like:

"style": {
    "visibility": "=if([$ContentType] == 'Folder', 'hidden', 'visible')"
}

OR

"style": {
    "display": "=if([$ContentType] == 'Folder', 'none', 'block')"
}

You can refer to this JSON sample which uses same expression to hide the button for folders: Download File Button

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.