Delete a Tab using Microsoft Flow

Steven Collier [MVP]
REgarding 365
Published in
3 min readJan 20, 2019
Photo by Mike Lewis HeadSmart Media on Unsplash

This article is a continuation of my series around automating the provisioning of Microsoft Teams using a combination of Flow, Azure Automation Runbooks and the Microsoft Graph. Catch up with the previous posts …

  1. Create a new Team in Microsoft Flow
  2. Add a tab to a Team channel in Flow

This posts will build on the concepts covered before to set up an Azure Automation account then write PowerShell scripts that call the Microsoft Graph. Just to pause as to why I’m taking this route, you’ll find other examples around where people call the graph directly from Flow, but I feel this route is currently better. Calling Graph from Flow uses the HTTP action, but as was announced in December this will become a premium only connector from February 2019. I also think that this approach creates a separation between the more technical scripts and Flow, once these Runbooks are accessed in Flow it’s easy to pass in your own parameters.

Anyway, on to todays script. In this example I’m going to delete a Tab based on the name of the tab. I’m going to find the relevant tab from it’s displayname as it’s perhaps unlikely that you’ll have the ID value for the tab before calling it.

The result being a nice reusable card in Flow where you can pass the ID values for a team and channel from standard Flow tasks

At this stage you are perhaps considering how you might use this new found ability to remove tabs, and realistically the primary use case would surely be to delete standard tabs created in a new Team. There’s only one you actually can delete, the Wiki tab, and I know lots of people don’t find a great deal of utility in the Wiki feature at the moment. Getting to the point in a flow to call our new Runbook is quite a complicated path, but ultimately possible.

If you are going to create the Team using my script from Part 1 then you’ll already have the Group ID passed back from job, your Convert JSON task will provide you with the value. You can find the General channel by using the standard Flow connector for Teams to get all Teams, then filter like …

We will come back to this topic of retrieving Group ID later in the series, as we look at how to trigger our Flows from different routes including triggering a default Flow for every new Team.

--

--