The ‘modern’ library experience is becoming the new normal. Being set as the default view in many tenants it is a great way of working with your data. Within this new experience the Flow and PowerApps button are great tools to work with this data. However in some cases you have a list where you want users to put in some data. Not use Flow or PowerApps to do anything else than to fill in the list. So you might have customers ask you to disable the buttons. Obviously you could disable the services on tenant level. Yet in most cases it is enough to disable them on list or site level.
Disable those buttons
Disabling Flow and PowerApps is possible but only on a web (or site collection) level. You can do so with PowerShell as described on Technet. As the sample only describes to disable Flow, and it is not using PnP-PowerShell I wrote a quick sample to achieve this using PnP-PowerShell. Besides the DisableFlows property there is a DisableAppViews property to disable the PowerApps button on the list as well! So your code would look something like the following
Connect-PnPOnline –Url https://digiwijs.sharepoint.com/sites/mytools-admin –Credentials (Get-Credential) $ctx = Get-PnPContext $ctx.Site.DisableAppViews = $true; $ctx.Site.DisableFlows = $true; $ctx.ExecuteQuery();
Your existing Flows and PowerApps will keep working and you are still able to go to waffle to start the Flow and PowerApps interfaces. However you will no longer see the buttons. Your hero bar will show the buttons when the DisableAppViews and DisableFlows are set to $false
The same hero bar will show no buttons when those properties are set to $true
Its an easy way to hide some of the options from your users on a site. Unfortunately you cannot set these values on the list level. But you can set them on web level. Just use the $ctx.Web and you are good to go.