create a hidden list

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.

Allow data to appear in search setting

I would probably also disable the list items within search.

Allow data to appear in search setting

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?

Create a list

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

Connect-PnPOnline -UseWebLogin
$list = Get-PnPList -Identity MyNewList

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

Set-PnpList -Identity MyNewList -Hidden $true

Alternatively if you need the hidden list to 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.

7 thoughts on “Create a hidden list in SharePoint Online

  1. commented on July 12, 2019 by teylyn

    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.

    • commented on July 12, 2019 by Pieter Veenstra

      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.

  2. commented on July 12, 2019 by Bill Brockbank

    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

  3. commented on July 12, 2019 by Bill Young

    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

    • commented on July 12, 2019 by Pieter Veenstra

      In this case they didn’t want to permission the data away as a PowerApp needed to managed the data. However the data should not be edited inside SharePoint.

Leave a Reply

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

%d bloggers like this: