Command bar customization does not work after MS Lists interface surfaces within SharePoint
This no longer appears to work with Microsoft List interface appearing within Microsoft SharePoint
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
- ID: 22dffaf9-de6c-5ec3-bd61-23b995c256ce
- Version Independent ID: 22dffaf9-de6c-5ec3-bd61-23b995c256ce
- Content: Command bar customization syntax reference
- Content Source: docs/declarative-customization/view-commandbar-formatting.md
- Service: sharepoint-online
- GitHub Login: @VesaJuvonen
- Microsoft Alias: vesaj
@daviduber1 We will take a look at this. Could you please share the formatter JSON with us?
I had this issue as well. In one instance it failed to hide the "new" button as the only one. In another list it seemed to not work at all. I got both scenarios to work again by pasting/saving the same json, emptying the browser cache and reloading the list. So perhaps there is a cache issue?
{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json", "hideSelection": false, "commandBarProps": { "commands": [ { "key": "new", "hide": true }, { "key": "manageForms", "hide": true }, { "key": "share", "hide": true }, { "key": "export", "hide": true }, { "key": "integrate", "hide": true }, { "key": "copyLink", "hide": true }, { "key": "edit", "hide": true } ] } }
Hello, I have the same issue, As a workaround I set the impacted lists as "Offline Client Availability" on Off. In this way SharePoint show me the standard interface and my customization appear normally. Are there some news about the resolution ? I'm not sure the workaround can work properly for a long time.
@Gregghis @MissHerku
We will work on this on priority. Could you please share a video or a test list where issue is a happening?
On a different note: Currently we are aware of a bug where hiding of a new button is not working when content type is enabled in the list. And we are working on it.
VideoListView.zip You can we in the attachment our behavior.
- Using Ctrl+f5 in reload we get the standard UI
- Refreshing or opening the list link we get the Lists UI
- Command Set are available in standard UI but not in Lists UI
@Gregghis Thanks for sharing the video. I see the issue. Seems like selectionModes is not working?
Could you please share the list schema by Exporting the list to csv with schema?
Note: This option will export the data too. Please export on a test list where this issue is happening.
@tpodugu-ms, export attached. SchemaList.zip
Differently from the scenario explained by MissHerku, In my case, buttons in commandbar are developed by SPFX Command Set based on this schema https://developer.microsoft.com/json-schemas/spfx/client-side-extension-manifest.schema.json
@Gregghis Thanks for the inputs. I will let the team know about the issue and update you on ETA.
OK .. so while not a development SPFx issue .. there is a work around to the Lists look an feel issue. If you wrap the List in a List webpart on a page .. the default display is back to the original Sharepoint list look-n-feel.
For update, Microsoft made a rollback of MS List view feature (for sure in my tenant)
I see the rollback as well .. good to see they recognized it as an issue.
@Gregghis is correct. We had been rolling out the new UI for lists with command set customizers, but halted that roll out due to 1) generalized issues with command sets when a list is set to sync, and 2) a specific event type not firing.
@reedpamsft thanks for your feedback. I can share my experience if it could be usefull for you. During some debugging activies we encounter differences on methods derived from class BaseListViewCommandSet onListViewUpdated(event: IListViewCommandSetListViewUpdatedParameters) onListViewUpdatedxxxxxx(args: ListViewStateChangedEventArgs): void onExecute(event: IListViewCommandSetExecuteEventParameters)
where the content of the event args are different called by MS List View integrated in SPO and the Modern one.
We just got a word from our Microsoft engineer that the issue is now solved and has been rolled out. According to our tests, the SPFx customization buttons are back, even without the above workaround (the Offline Client Availability). And we are back to the SP-style UI for the lists.
You will probably need to refresh with Ctrl+F5. We are on version 16.0.0.25304 (https://your_tenant.sharepoint.com/_vti_pvt/service.cnf)
We're having issues renaming the New command button as of Jan 6, 2025.
{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json", "commandBarProps": { "commands": [ { "key": "new", "text": "My New Label" } ] } }
When applying the above JSON to the list view, there appears to be a slight change in formatting of the command bar. But the target button label text isn't changed.
Before JSON:
After JSON:
@SJNBham Please use key: newComposite for new dropdown command. Please expect a document update on this soon.
Ah - what a hero @tpodugu-ms! Thank you ;) The following does update the label for the New command bar button (substitute the key "new" with "newComposite"):
{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json", "commandBarProps": { "commands": [ { "key": "newComposite", "text": "New Training Request" } ] } }
After playing around with this a bit more, we discovered that the reason the "new" key value wasn't working and the "newComposite" key value worked is that we had Content Types enabled for the list. So "newComposite" works if Content Types is enabled and "new" will work if Content Types aren't enabled for the list.
We noticed the styling of the New button doesn't change (remains blue) when using the "new" key value, but does change (turns white) when using the "newComposite" key value.
Thanks @SJNBham for the details on the scenario.
- Yes dropdown will show up if content types is enabled for the list.
- I will let the team know about this behavior. Blue color indicates that command is a primary command. You can apply primary: true prop to make any command primary. Eg: { "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json", "commandBarProps": { "commands": [ { "key": "newComposite", "text": "New Training Request", "primary":"true" } ] } }
Thanks for the tip on the styling @tpodugu-ms. Adding the "primary":"true" value did return the New button to the blue styling. So the final code for styling a list with Content Types enabled is:
{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json", "commandBarProps": { "commands": [ { "key": "newComposite", "text": "New Button Label", "primary":"true" } ] } }
Hello @daviduber1, The recent updates outlined in the documentation for Command Bar Customization may help address the issue you've encountered. These enhancements provide improved support and flexibility for customizing the command bar through JSON formatting, which could align better with your current requirements.
Thanks @Ashlesha-MSFT, really appreciate the support that has been provided here and good to see we weren't the only ones in the same boat.