Hide SharePoint List or Library using Power Automate
Description:
In this article, we will explore how to hide a SharePoint list or library from view and search, while still allowing access by name if known. This can be achieved through Power Automate by sending HTTP requests to SharePoint. This method is useful for managing sensitive or rarely-used lists without deleting or archiving them.
Audience and Purpose:
This guide is intended for developers, Power Platform users, and SharePoint administrators who wish to manage SharePoint visibility without permanently removing lists or libraries. The main goal is to demonstrate how to programmatically hide or unhide a list/library using Power Automate, ensuring better control over site content.
Introduction
Managing SharePoint lists and libraries is crucial for maintaining organized and efficient environments. However, there are scenarios where you may need to hide specific lists or libraries from public view or search results. This could be for archiving, sensitive data storage, or simply reducing clutter. By leveraging Power Automate, users can easily show or hide lists dynamically without manually altering SharePoint settings.
This method is particularly helpful for users who do not have direct administrative access but need to manage list visibility programmatically.
Prerequisites:
Before proceeding, ensure the following conditions are met:
- Power Automate Access: Access to Power Automate to create and run flows.
- SharePoint Permissions: Appropriate permissions to send HTTP requests to SharePoint.
- SharePoint Site URL: URL of the SharePoint site containing the list/library.
- List/Library Title: The exact name of the list or library to hide.
Step-by-Step Guide:
How to Hide Hide SharePoint List or Library
1. Create a Manual Flow in Power Automate
- Log in to Power Automate.
- Click on Create and select Instant cloud flow.
- Choose Manually trigger a flow and click Create.
2. Add Action: Send an HTTP Request to SharePoint
- In the flow editor, click on + New Step.
- Search for Send an HTTP request to SharePoint and add this action.
3. Configure HTTP Request
Site Address: Select or enter the URL of your SharePoint site.
Method: Set to POST.
URI: Use the following endpoint:
/_api/web/lists/getBYTitle('{ListName}')
Replace {ListName}
with the exact title of the list or library.
Headers:
{ "X-HTTP-Method": "MERGE", "Accept": "application/json;odata=verbose", "Content-Type": "application/json;odata=verbose", "IF-MATCH": "*" }
Body:
{ "__metadata": { "type": "SP.List" }, "Hidden": true, "NoCrawl": true }
This body will hide the list from standard view and prevent it from appearing in search results.
4. Run the Flow
- Save and run the flow.
- Once executed, the list or library will no longer be visible in SharePoint, but users can still access it if they know the name.
Enabling or Showing the List in Search Results
To unhide the list or make it searchable again, modify the Body section of the HTTP request to:
{
"__metadata": { "type": "SP.List" },
"Hidden": false,
"NoCrawl": false
}
- Run the updated flow, and the list/library will reappear in standard view and search results.
Additional Tips and Best Practices:
- Testing: Always test the flow in a development environment before applying changes to a production site.
- Permissions: Ensure the account running the flow has appropriate permissions to make changes to SharePoint lists.
- Documentation: Maintain documentation of hidden lists for future reference.
- Error Handling: Implement error handling within the flow to manage scenarios where the list name is incorrect or permissions are insufficient.
Conclusion:
By utilizing Power Automate, users can efficiently manage the visibility of SharePoint lists and libraries. This process not only declutters sites but also enhances security by limiting exposure to sensitive information. This approach provides flexibility and control, allowing administrators and developers to manage lists dynamically without permanent deletions.
Embrace Power Automate to streamline SharePoint management and ensure better governance of your digital workspace.
✨ Thanks for reading! ✨
I hope you found this blog on the Microsoft Power Platform helpful! From Power Apps, Power Automate (Cloud & Desktop), Canvas Apps, Model-driven Apps, Power BI, Power Pages, SharePoint, Dynamics 365 (D365), Azure, and more, I cover a wide range of topics to help you harness these powerful tools. Don’t miss out on future tips, tutorials, and insights—hit that subscribe button to get the latest posts right to your inbox. 💌💬 I’d love to hear your thoughts! Drop a comment below with your questions, ideas, or feedback—let’s get the conversation started!🔗 Let’s connect and grow together!
Follow me, Ravindra Jadhav, on your favorite platforms for even more content and updates on Microsoft Power Platform and related technologies:
💼 LinkedIn – Let’s network and share ideas!
💻 GitHub – Explore my projects and code.
🐦 Twitter – Stay updated with quick tips and industry news.
📺 YouTube – Watch tutorials and deep dives on Power Platform, Power Apps, Power Automate, and more! Let’s build something amazing together with Power Platform and Azure! 🚀