If you’ve ever needed to conceal a button in your SharePoint Online list or document library, you’re in the right place. Whether it’s the “New” or button or any other, you can achieve this using list view formatting with just a few lines of JSON code.
Here’s how you can hide a button from the SharePoint Online list view:
- Navigate to the List or Document Library:
- Open the SharePoint list or document library where you want to hide the button.
- Access View Formatting:
- Click on the View dropdown menu.
- Choose “Format current view” from the options.
- Advanced Mode:
- In the formatting pane, click on “Advanced Mode” to access the JSON editor.
- Hide the New Button:
- Paste the following JSON snippet to hide the “New” button from the toolbar:
- {
- “commandBarProps” : {
- “commands”: [
- {
- “key”: “new”,
- “hide”: true
- },
- {
- “key”: “editInGridView”,
- “text”: “Quick edit”,
- “iconName”: “EditTable”,
- “primary”: true
- },
- {
- “key”: “share”,
- “iconName”: “”,
- “title”: “Share this List”
- }
- ]
- }
- }
- This will effectively hide the “New” button.
- Customization Options:
- Remember that the command bar customization method isn’t limited to hiding buttons. You can also:
- Rename button text.
- Replace icons.
- Change the order of buttons.
- Remember that the command bar customization method isn’t limited to hiding buttons. You can also:
Toolbar Key
‘new’
‘newFolder’
‘newWordDocument’
‘newExcelWorkbook’
‘newPowerPointPresentation’
‘newOneNoteNotebook’
‘newFormsForExcel’
‘newVisioDrawing’
‘upload’
‘uploadFile’
‘uploadFolder’
‘open’
‘share’
‘copyLink’
‘download’
‘rename’
‘copyTo’
‘moveTo’
‘delete’
‘edit’
‘comment’
‘editNewMenu’
‘powerBI’
‘powerBIVisualizeList’
‘automate’
‘automateCreateRule’
‘automateManageRules’
‘powerAutomate’
‘powerAutomateCreateFlow’
‘powerAutomateSeeFlows’
‘powerAutomateConfigureFlows’
‘aiBuilderCreate’
‘aiBuilderGoto’
‘aiBuilder’
‘alertMe’
‘newLink’
‘integrate’
‘manageAlert’
‘powerApps’
‘powerAppsCreateApp’
‘powerAppsSeeAllApps’
‘powerAppsCustomizeForms’
‘viewDocumentUnderstandingModels’
‘versionHistory’
‘openInImmersiveReader’
‘classifyAndExtract’
‘checkOut’
‘checkIn’
‘undoCheckOut’
‘properties’
‘pinItem’
‘exportExcel’
‘exportCSV’
‘export’
‘editInGridView’
‘exitGridView’
‘sync’
‘uploadTemplate’
‘addTemplate’
‘openInOfficeOnline’
‘openInOfficeClient’
‘addShortcut’
‘pinToQuickAccess’
‘unpinFromQuickAccess’