Hiding a SharePoint List from the Site Contents using Power Automate

Sometimes when building any solution based on SharePoint we need to hide a list from the site contents, for several reasons. The list can be creted to be used only by an automated solution and not to be updated or accessed by users. Even if we restrict permissions to read-only in the list, this can cause some confusion in users.

Using SharePoint Designer we can mark a list as hidden from the site contents easily, and the same can also be done using PowerShell or SharePoint APIs.

But not all the time it’s possible to use/install PowerShell or SharePoint Designer in our computers. And also it’s important to bear in mind that SharePoint designer will be discontinued at some point in the near future.

So how can we do it without PowerShell or SharePoint designer?

Use a Power Automate Flow and the powerful Send an HTTP Request to SharePoint action!

The basics

To hide a list from the site contents, we simply need to make a call to the SharePoint REST API using the following parameters, as in the sample below:

  • SiteUrl: your site URL
  • Method: POST
  • Uri: _api/web/Lists/getbytitle(‘Your list title’)
  • Headers:
    • X-HTTP-Method: Merge
    • If-Match: *
  • Body: { ‘Hidden’: true}

Full working sample

You can get a full working flow from this link and import it.

It’s a manually triggered flow, so you need to run it manually to hide a SharePoint list, using as parameters:

  • Site Url
  • List title
  • Hidden (Toggle on hides a list/Toggle off makes a hidden list visible again)

Sample flow working and hiding a list:

Note that the ‘Issue tracker’ list is hidden after the flow is executed. This flow also sends you the link of the list in an e-mail message when successful:

And the link to the failed flow run when it fails:

Conclusion

With Power Automate and the SharePoint REST API we are able to hide or show lists from the site contents.

Note that this does not remove any permissions from the list. Users with the list link will still be able to access it via the direct list URL.

This blog is part of SharePoint Week. Find more here.

About the Author:

SharePoint/Microsoft 365 Consultant
Microsoft techologies enthusiast

About the Author:

Mendes, M (2022). Hiding a SharePoint list from the site contents using Power Automate. Available at: https://michelcarlo.com/2022/01/30/hiding-a-sharepoint-list-from-the-site-contents-using-power-automate/  [Accessed: 28th April 2022]. 

Share this on...

Rate this Post:

Share:

Topics:

SharePoint

Tags: