With the recent change of the Lists being available in the app bar in global navigation, we had a new requirement: hide some SharePoint lists from our users.
I have seen it done with PowerShell and SharePoint Designer, it’s already written elsewhere, so please take a look there, if you are interested in those solutions: https://www.sharepointdiary.com/2013/06/how-to-hide-list-or-library-in-sharepoint.html
I’ve tried with PowerShell and SharePoint Designer, but in the end, I decided to give it a go with SharePoint REST API and Power Automate.
The Send an HTTP request to SharePoint looks like this:
Pick your site address, set the Method to POST.
For the Uri field, pick one from the following:
/_api/web/lists(guid'your list ID')
/_api/web/lists/getByTitle('your list name')
Headers:
{
"accept ": "application/json;odata=verbose",
"content-type": "application/json;odata=verbose",
"IF-MATCH": "*",
"X-HTTP-Method": "MERGE"
}
Body:
{
"__metadata":
{
"type": "SP.List"
},
"Hidden": "true"
}
Once you hide your lists, it won’t be available in Microsoft Lists, Site Contents of the given SharePoint site, dropdowns in Power Automate. You can unhide your lists by changing the “Hidden” property to “false”.
This can work as part of a batch or triggered from Power Apps or triggered by a manual Power Automate button.
I hope it is helpful!