SharePoint Modern JSON Formatting - Hide Filter Elements

Tom Molskow 386 Reputation points
2023-06-26T02:57:25.53+00:00

Hello Community,

I have been working in SharePoint Modern, and I am looking trying to hide all the command bar elements in an Embedded Web Part. Using JSON, I have been able to hide most of the command bar elements, but not the filter elements - see code and graphic below:

User's image

 "commandBarProps": {
    "commands": [
      {
        "key": "new",
        "hide": true
      },
      {
        "key": "editInGridView",
        "hide": true
      },
      {
        "key": "share",
        "hide": true
      },
      {
        "key": "export",
        "hide": true
      },
      {
        "key": "automate",
        "hide": true
      },
      {
        "key": "integrate",
        "hide": true
      },
      {
        "key": "alertMe",
        "hide": true
      },
      {
        "key": "manageAlert",
        "hide": true
      },
      {
        "name": "Nintex Workflow",
        "hide": true
      }
    ]
  }

Has anyone else managed to do this? To hide the entire toolbar or at least the filter elements? If so please provide guidance and code examples.

Thanks!

Tom

Microsoft 365 and Office SharePoint Development
Microsoft 365 and Office SharePoint For business Windows
0 comments No comments
{count} votes

Accepted answer
  1. RaytheonXie_MSFT 40,471 Reputation points Microsoft External Staff
    2023-06-26T08:51:53.8833333+00:00

    Hi @Tom Molskow

    Per my research, you can hide following button in command bar. The Nintex Workflow property doesn't included. There is currently no exact way to hide the Nintex Workflow button. Here is the document about valid keys

    https://learn.microsoft.com/en-us/sharepoint/dev/declarative-customization/view-commandbar-formatting

    As a workaround you could hide the command bar in the list web part without code execution.
    Edit the list web part in the page and disable the "show command bar" option.

    User's image


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.