skip to content
Federico's Blog
Table of Contents

The problem

In many companies data must be managed only through a specific process (for example via custom PowerAutomate flow) and allowing users, for example, to ๐—ณ๐—ฟ๐—ฒ๐—ฒ๐—น๐˜† create items in a list can ๐—ฒ๐—ฎ๐˜€๐—ถ๐—น๐˜† ๐—ฏ๐—ฟ๐—ฒ๐—ฎ๐—ธ ๐˜๐—ต๐—ฎ๐˜ ๐—ฝ๐—ฟ๐—ผ๐—ฐ๐—ฒ๐˜€๐˜€.

Static image

What to do?

You can manage this scenario with complex solutions, sure, but I think sometimes small declarative customizations can significantly improve governance and user behavior without complexity.

In this case with SharePoint you can easily: โ€ข Hide specific commands โ€ข Change the label of a command โ€ข Reorder commands in the bar โ€ข And more

๐Ÿ“„ Here the Microsoft documentation: https://learn.microsoft.com/en-us/sharepoint/dev/declarative-customization/view-commandbar-formatting

How to?

Below an example of how to hides the โ€œ๐—ก๐—ฒ๐˜„โ€, โ€œ๐—˜๐—ฑ๐—ถ๐˜ ๐—ถ๐—ป ๐—ด๐—ฟ๐—ถ๐—ฑ ๐˜ƒ๐—ถ๐—ฒ๐˜„โ€, and โ€œ๐—ฆ๐—ต๐—ฎ๐—ฟ๐—ฒโ€ commands in a SharePoint list by formatting a specific view (for example, the โ€œAll Itemsโ€ view).

{
"commandBarProps": {
"commands": [
{
"key": "new",
"hide": true
},
{
"key": "editInGridView",
"hide": true
},
{
"key": "share",
"hide": true
}
]
}
}

Conclusion

๐—ง๐—ต๐—ถ๐˜€ ๐—ถ๐˜€ ๐—ผ๐—ป๐—น๐˜† ๐—ฎ ๐˜‚๐˜€๐—ฒ๐—ฟ ๐—ถ๐—ป๐˜๐—ฒ๐—ฟ๐—ณ๐—ฎ๐—ฐ๐—ฒ ๐—ฐ๐˜‚๐˜€๐˜๐—ผ๐—บ๐—ถ๐˜‡๐—ฎ๐˜๐—ถ๐—ผ๐—ป. Ensure that users do not have permissions to create custom views as they could otherwise bypass these UI restrictions. In a document library context, for example, hiding the โ€œNewโ€ button does not fully prevent file creation since users can still add files via drag & drop.

In a SharePoint list context where drag & drop is not supported this approach becomes a ๐—น๐—ผ๐˜„-๐—ฐ๐—ผ๐˜€๐˜, ๐—น๐—ผ๐˜„-๐—ถ๐—บ๐—ฝ๐—ฎ๐—ฐ๐˜, ๐—ต๐—ถ๐—ด๐—ต-๐˜ƒ๐—ฎ๐—น๐˜‚๐—ฒ solution.

LinkedIn relative post

https://www.linkedin.com/posts/federicotosetto_sharepoint-powerautomate-sharepoint-activity-7411447348297502720-J2gv?utm_source=share&utm_medium=member_desktop&rcm=ACoAACKJlEABegKcSpQKizAvOzyH46f6JvcIZbM