Author Details

avatar-teacher

Evolvous

We are a team of tech enthusiast and this section is where we love to share our experience and our knowledge. We try our best to help you understand technical topics by giving you live instances of how-to’s, guides, tips, FAQ’s and troubleshoots.

If you like it or have questions, do share your feedback in the comments section below.

In this blog post, we’ll see how we can hide any SharePoint list or libraries using Power Automate.

Why should we hide list or library?

Sometimes when we build any solution that is going to use by some automations, and we don’t want anyone from the organization to remove unintentionally. Even if we restrict user permission to read only, this can cause confusion to end users.

Alternate ways

We can perform the same action with PowerShell or SharePoint Designer. But it’s not possible all the time to install and use the app. Also, SharePoint designer will be discontinued in near future.

Demo

To hide any list from flow, we will call SharePoint Rest API with some parameters from Power Automate.

  1. Create a blank flow and choose manual trigger –

hide any SharePoint list or libraries using Power Automate - Evolvous

2. In the next step we will define following parameters –

    1. Site Address: A text field to enter site URL.
    2. Hide: A Yes/No filed to toggle hide/unhide while trigger.
    3. Site or Library Name: A text field to enter list or library name.

Sebd an Http request to SharePoint - Evolvous

3. In the next step we’ll add the SharePoint HTTP Request action.

Manually Triger a flow - Evolvous

In this action –

  1. Site Address: the dynamic content of Site Address from the trigger.
  2. Method: PATCH
  3. Uri: _api/web/Lists/getbytitle(‘@{trim(triggerBody()[‘text_1′])}’)
  4. Headers:
    • X-HTTP-Method: Merge
    • If-Match: *
  5. Body:
    {

'Hidden':@{if(triggerBody()['boolean'],'true','false')}

}

Explanation: In the above SharePoint HTTP Action –

  1. We are directly using the Site Address parameter from trigger.
  2. The HTTP method will be PATCH as the list or library is already exist and we are updating its properties.
  3. The Uri address contains the dynamic value of the list or library name from the trigger, and we use trim expression to narrow down the unnecessary space before and after the list or library name.
  4. The Headers will be as shown in above.
  5. In body, we’ll define the Hidden property and use the dynamic value Hide with an if condition that if it toggle yes, the value will be true in body else false.

Working Demo

Following is the working demo for the above solution –

Additional Microsoft Resources

  1. Working with the SharePoint Send HTTP Request flow action in Power Automate
  2. Microsoft SharePoint Connector in Power Automate
  3. Manage list item and file permissions with Power Automate flows

Conclusion

Well, this is the end of this post. This is a reusable flow, and you can use this flow to hide/unhide any list or libraries in SharePoint online.

Let me know if you have any queries or suggestions in the comment below. I will see you next time, till then, Happy Learning!