Skip to content

Commit aa764e8

Browse files
000-529: hidebuttons
1 parent 7d3a8b9 commit aa764e8

File tree

8 files changed

+97
-9
lines changed

8 files changed

+97
-9
lines changed

articles/en/SharePointOnline/hidebuttons.md

Lines changed: 97 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ date: '2024-11-09'
1010
---
1111

1212

13-
This article will give you a few json formatting examples on how to hide buttons in the command bar of a SharePoint list view, such as "add new item", or "automate".
13+
This article will give you a few JSON formatting examples on how to hide buttons in the command bar of a SharePoint list view, such as "add new item", or "automate".
1414

1515

1616
# TL;DR;
1717

18-
You can hide one or more buttons in the command bar of your SharePoint list by using the following json. Pick only the keys you want to hide!
19-
18+
You can hide one or more buttons in the command bar of your SharePoint list by using the following JSON. Pick only the keys you want to hide!
2019

20+
```json
2121
{
2222
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json",
2323
"commandBarProps": {
@@ -94,27 +94,115 @@ You can hide one or more buttons in the command bar of your SharePoint list by u
9494
}
9595
}
9696

97+
```
9798

9899

99100
# Intro
100101

101102
The command bar in SharePoint Online list view has several buttons:
102103

104+
* Add new item
105+
* Edit in grid view
106+
* Undo
107+
* Share
108+
* Export
109+
* Forms
110+
* Automate
111+
* Integrate
112+
* Alert me
113+
* Manage my alerts
103114

104115

105-
And some extra ones that appear when you select an item:
106-
116+
And some extra buttons that appear in the command bar when you select an item:
107117

118+
* Edit
119+
* Share
120+
* Copy link
121+
* Comment
122+
* Delete
123+
* Version history
108124

109125

110-
IMG
126+
<img src="/articles/images/hidebuttons7.png" >
111127

112-
A list of command bar buttons with the corresponding key:
128+
<img src="/articles/images/hidebuttons.png" >
113129

114130

115131
# Hide a button in the command bar
116-
If you want to hide e.g. "add new item" button in the command bar of your SharePoint Online list, navigate to
117132

133+
If you want to hide e.g. "add new item" button in the command bar of your SharePoint Online list, navigate to the view name on the right (e.g. "All Items"), and click "Format current view"
134+
135+
<img src="/articles/images/hidebuttons3.png" >
136+
137+
At the bottom there is an Advanced Mode button. You may need to scroll. Click on the Advanced Mode:
138+
139+
<img src="/articles/images/hidebuttons2.png" >
140+
141+
and enter the JSON code with your selected keys.
142+
143+
<img src="/articles/images/hidebuttons4.png" >
144+
145+
146+
147+
Mind you, the buttons are only hidden. The functionalities still exist. Hiding the keys from the SharePoint list does not affect users' permissions. If they find a creative way (e.g. via Graph API) to add a new item, or create a flow starting from Power Platform entry point - they can still do it.
148+
149+
### A list of command bar buttons with the corresponding key
150+
151+
The keys have very intuitive names. Most of them are called exactly by their display name (the name you see in the user interface). There are only a few exceptions. Here you can find the list of command bar buttons with the corresponding key:
152+
153+
| Name | Key |
154+
| -------- | ------- |
155+
| Add new item | new |
156+
| Edit in grid view | editInGridView |
157+
| Undo | undo |
158+
| Share | share |
159+
| Export | export |
160+
| Forms | manageForms |
161+
| Automate| automate |
162+
| Alert me | alertMe |
163+
| Manage my alerts | manageAlert |
164+
| Edit | edit |
165+
| Copy link | copyLink |
166+
| Comment | comment |
167+
| Delete | delete |
168+
| Version history | versionHistory |
169+
170+
# Examples
171+
172+
### Example 1
173+
174+
Hide the alerts functionality - "Alert me" and "Manage my alerts":
175+
176+
<img src="/articles/images/hidebuttons5.png" >
177+
178+
179+
```json
180+
{
181+
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json",
182+
"commandBarProps": {
183+
"commands": [
184+
{
185+
"key": "alertMe",
186+
"hide": true
187+
},
188+
{
189+
"key": "manageAlert",
190+
"hide": true
191+
}
192+
]
193+
}
194+
}
195+
196+
```
197+
198+
### Example 2
199+
200+
Hide **Share**, **Export**, and **Automate** buttons from the command bar of the SharePoint list:
201+
202+
<img src="/articles/images/hidebuttons4.png" >
203+
204+
### Example 3
118205

206+
Hide **Forms** button from the command bar of the SharePoint list:
119207

120-
Examples
208+
<img src="/articles/images/hidebuttons6.png" >

articles/images/hidebuttons.png

20.6 KB
Loading

articles/images/hidebuttons2.png

27.1 KB
Loading

articles/images/hidebuttons3.png

38.8 KB
Loading

articles/images/hidebuttons4.png

64.1 KB
Loading

articles/images/hidebuttons5.png

81.2 KB
Loading

articles/images/hidebuttons6.png

50.8 KB
Loading

articles/images/hidebuttons7.png

25.9 KB
Loading

0 commit comments

Comments
 (0)