Create a hidden list in SharePoint Online

Today at the user group meeting one of the attendees had a nice idea to hide data in a list from the SharePoint interface. He created one list item with a title “You should not be here”. Then he made that item the only visible item in the default view. The he made the list accessible through PowerApps it this was the process the make it harder to access the data as a normal user.

Administrators can look at the data (if really needed with personal views), while permissions for normal users do not include updating of views.

I would probably also disable the list items within search.

Hidden lists

I then started to think about this and hidden lists. How do you create hidden lists without code? First I created a new list.

Hey, who changed the create a list interface?

Then when the list was created a few powershell commands did the trick

Connect-PnPOnline https://pieterveenstramvp.sharepoint.com -UseWebLogin
$list = Get-PnPList -Identity MyNewList
$list.Hidden=$true
$list.Update()
$list.Context.Load($list)
$list.Context.ExecuteQuery()

As mentioned by Bill in the comments below you can also use:

Set-PnpList -Identity MyNewList -Hidden $true

Alternatively if you need the hidden listvto be part of a template you can also use Apply-PnpProvisioningTemplate of course.

Rather than hiding data using views, if you want to hide all data in a list from users then hiding the full list might be the better option.

Advertisements

7 thoughts on “Create a hidden list in SharePoint Online

  1. There’s also a setting in SharePoint Designer that can be used to hide the list from the browser. If you don’t have permissions to run PowerShell in your tenant, this will probably be accessible. It is ticked by default for the Workflow History list, so it normally does not show in the All Contents view.

    Like

    1. Agreed, but then SharePoibt Designer is more and more failing for me. I wouldn’t really consider it as part of my supported set of tools anymore. I only use it sometimes as a last resort.

      Like

  2. To much PowerShell Code
    to make a list hidden just use the following:
    Set-PnpList -Identity MyNewList -Hidden $true

    No need to access the object model.

    Bill Brockbank

    Like

  3. My approach was to remove the items from search, break permissions from the site and remove permissions from the site but not the lists. That way data was available to the admin but non-admins have to know the name of the site and the list to get to it

    Like

Please leave a comment or feedback

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.