SharePoint / SharePoint/sp-dev-docs
Keys not working for specific JSON command bar customizations
@Ashlesha-MSFT is already working on this.
Since Jul 4, 2025.
- Dominant language
- PowerShell
- Stars
- 1.4k
- Forks
- 1.1k
- Avg merge
- 4d 12h
- Merged PRs (30d)
- 12
Description
Target SharePoint environment
SharePoint Online
What SharePoint development model, framework, SDK or API is this about?
Declarative list formatting
Developer environment
None
What browser(s) / client(s) have you tested
- 💥 Internet Explorer
- 💥 Microsoft Edge
- 💥 Google Chrome
- 💥 FireFox
- 💥 Safari
- mobile (iOS/iPadOS)
- mobile (Android)
- not applicable
- other (enter in the "Additional environment details" area below)
Additional environment details
Microsoft Edge
Describe the bug / error
I have tested all keys at https://learn.microsoft.com/en-us/sharepoint/dev/declarative-customization/view-commandbar-formatting including the changes detailed in the recent updates section.
The following keys relate to both Lists and Document libraries and do not function in either of them:
automateCreateRule
automateManageRules
powerAppsCreateApp
powerAppsSeeAllApps
powerAppsCustomizeForms
powerBIVisualizeList
The following keys relate to Document libraries and do not function:
newWordDocument
newExcelWorkbook
newPowerPointPresentation
newOneNoteNotebook
newFormsForExcel
newVisioDrawing
newLink
editNewMenu
uploadFile
openInOfficeOnline
openInOfficeClient
openInImmersiveReader
The following key relates only to Lists and does not function:
powerAppsCreateApp
All others keys function as expected.
By way of brief summary the keys for the lowest level menu items in the hierarchy do not function. There are exceptions to:
- newFolder and addTemplate function under newComposite function but all its sibling keys do not.
- stasherCommand.myFiles, stasherCommand.otherLocation, complianceDetails and PublishCommand keys function.
The key I am most keen to get fixed is newLink.
Thanks in advance :)
Steps to reproduce
1.I have tested on multiple lists and document libraries across multiple SharePoint sites and browsers.
2. I have used one key at a time and have verfified all other keys work.
3. I have used two keys at a time and have verfified one works and the keys above do not.
4.This is very straighforward to replicate,
Expected behavior
That the keys above could be used to hide specific items. An example is below:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json",
"commandBarProps": {
"commands": [
{ "key": "newFolder", "hide": true },
{ "key": "newWordDocument", "hide": true },
{ "key": "newExcelWorkbook", "hide": true },
{ "key": "addTemplate", "hide": true }
]
}
}
newFolder and addTemplate function correctly. newWordDocument and newExcelWorkbook do not function correctly.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.