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 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 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.

9 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.

    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.

  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

  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

  4. Hi Peter, just reading your blog post today and when I saw that you wrote ‘You should not be here’ – I thought – that’s what I write in my SP lists. Then I saw the date 12 July, and then I realised I was in London and attended that UG session and it was most probably me who said this ‘nice idea’!! I do vaguely recall you asking me a question about PowerShell and I probably gave you a dumb look back in return because we like most people don’t have the Admin privileges reqd as Teylyn rightfully also pointed out. But this has helped me start the ball rolling with those who are in the seat of power, so thank-you!

Leave a Reply

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

%d bloggers like this: