Hide view in Microsoft Lists

Photo by Brando Louhivaara on Unsplash

Microsoft Lists views are powerful, and you can adjust them as your need. You can have basic ones for regular users and more advanced ones, for instance for the admins of the site. Obviously, all the views are available for all the users which will have access to them. However, a few weeks ago I found that you can hide those views.

The following PowerShell script, using PnP will allow you to hide the View from all users who can see it.

$siteUrl = "https://contoso.sharepoint.com/sites/site"
$listName = "Announcements"
$viewName = "List View"

Connect-PnPOnline -Url $siteUrl -UseWebLogin
Set-PnPView -List $ListName -Identity $ViewName -Values @{Hidden = $true }

Conclusion

If you need to access that hidden view, you can use the URL of the view and it opens your hidden view. The downside is that you cannot see that view in the List Settings; to access it you will need to use the URL and then click to edit the current view. With this being said, be careful using this because you can lose track of those hidden views. The only way to know which views are hidden, you need to execute the following PowerShell Script.

$siteUrl = "https://contoso.sharepoint.com/sites/site"
$listName = "Announcements"

Connect-PnPOnline -Url $siteUrl -UseWebLogin
Get-PnPView -List $ListName 

3 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *