1

I am trying to customize a modern page command bar and have found some documentation to hide the new button:

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json",
  "commandBarProps": {
    "commands": [
      {
        "key": "new",
        "hide": true
      }
    ]
  }
}

So far so good, however I am trying to make multiple customizations and also remove the following:

  • Add shortcut to OneDrive
  • Pin to quick access
  • Export to excel
  • Automate
  • Integrate

how can I manage multiple customizations in the JSON code?

Thanks

1 Answer 1

0

Following JSON should work for you:

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json",
  "commandBarProps": {
    "commands": [
      {
        "key": "new",
        "hide": true
      },
      {
        "key": "addShortcut",
        "hide": true
      },
      {
        "key": "pinToQuickAccess",
        "hide": true
      },
      {
        "key": "exportExcel",
        "hide": true
      },
      {
        "key": "automate",
        "hide": true
      },
      {
        "key": "integrate",
        "hide": true
      }
    ]
  }
}

Step by step instructions here: https://www.youtube.com/watch?v=hGlaofOZIhg

Also command bar customization article here: https://learn.microsoft.com/en-us/sharepoint/dev/declarative-customization/view-commandbar-formatting

Note that certain key values may not work for libraries. For example, using exportExcel as the key will not hide the action from the command bar in libraries. Instead, you can use the key export to achieve the desired effect.

There are different keys available depending on whether you are customizing a list or a library. To explore and discover the appropriate keys for your customization needs, you can use the helpful tool provided here: https://sharepointdashboards.com/PRE/?t71. This tool can assist you in identifying the correct keys to hide specific actions from the command bar.

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.