0

I have tried using the following JSON code to hide the "new" button from SharePoint list but it has no effect. It works on all other buttons except new. Can some please help?

Here is the JSON:

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json",
  "commandBarProps": {
    "commands": [
      {
        "key": "new",
        "hide": true
        
      },
      {
        "key": "New",
        "text": "Fred",
        "iconname": "Fred"
      },
      {
        "key": "share",
        "hide": true
      },
      {
        "key": "edit",
        "hide": true
      },
      {
        "key": "automate",
        "hide": true
      },
      {
        "key": "alertMe",
        "hide": true
      },
      {
        "key": "integrate",
        "hide": true
      },
      {
        "key": "manageAlert",
        "hide": true
      }
    ]
  }
}
2
  • Why are you using new and New key 2 times in your JSON? Commented Jun 20 at 8:06
  • I agree with Ganesh Sanap. I am checking the status of this case. Please let us know if you would like further assistance. If you have any update about this issue, please feel free to post back.
    – Xyza_MSFT
    Commented Jun 21 at 2:42

1 Answer 1

1

I just tried using below JSON in SharePoint list view formatting and it works fine for me:

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

Output:

enter image description here

Note: New button will not be hidden from all views by default. It will be hidden only from the list view where you have applied the JSON.

Documentation: SharePoint JSON formatting - Command bar customization syntax reference.

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.