Provision Teams using Power Apps and Power Automate

If you are an Office 365 admin who wants to streamline requests to create teams in Microsoft Teams, this blog post was written exactly for you. Those who aren’t admins, share this blog post with your Office 365 admin and push them to implement this. It’s a win for all!

Solution Overview

Step 1 – Download the .zip package from my GitHub repo.

Step 2- Install the flows and the Power App

Import the following package in Power Automate / Power Apps in the following order –

a. Import ‘1 DeploySPListforTeamsrequests’ .zip file in Power Automate. This flow creates a SharePoint list for you so you don’t need to manually create one. I know, that’s so cool! 😀


b. Import ‘2 TeamRequestsApprovalFlow’ .zip file in Power Automate.
Refer https://flow.microsoft.com/en-us/blog/import-export-bap-packages/ if you haven’t imported a flow before.

This flow will be triggered every-time a new item is created in the SharePoint list. This way the flow can run in context of the admin and thus the Graph HTTP requests will work fine.

For the HTTP with Azure AD connection , enter https://graph.microsoft.com for both the Base resouce URL and Azure AD Resource URI (Application ID URI).

This connector is a premium connector. If you don’t have a premium license, you can get a Power Apps Community plan (https://powerapps.microsoft.com/en-us/communityplan/) and install this flow in the community plan environment where you can use any Premium connectors as well.

FYI – Community plans should only be used for testing purpose. To run it in production, you will need one per user license for Power Automate (as of March 31, 2020)


c. Import ‘3 IneedaTeam PowerApp’ .zip file in Power Apps.
Refer https://docs.microsoft.com/en-us/power-platform/admin/environment-and-tenant-migration#importing-a-canvas-app if you haven’t imported an app before.

Step 3 – Run the flow “Deploy SP List for Teams requests”

Before you run this flow, click on ‘Edit’ to edit the action marked 🟡 .

Edit the SharePoint Site URL where you want to create a SharePoint List

This SharePoint List will be the repository where all the requests will be submitted. This list will have to be shared with all the organizations’ employees with a Contribute permission so that they can add the requests.

Now, run the flow by clicking on ‘Run’. This will create a SharePoint list with all the columns required to submit requests for a new Team.

Step 3 – Edit the flow “Team Requests Approval Flow”

Edit all the actions marked 🟡 in the flow.

a. Change the SharePoint site address and choose the list that was created in the previous step.

b. Change the list of Approvers . Add a list of email-ids separated by ; to whom the approval request should be sent. Any one of them can give the approval.

c. There are two more actions inside the condition where you will need to change the SharePoint site address and the list.

Step 4 – Change Data source and App OnStart for “I need a Team” Power App.

Data Source

The data source will currently point to the SharePoint list in my tenant, so you need to change that to point to your SharePoint list.

Delete the existing SharePoint connection and add a new connection that points to the list that you created in Step 2 above. You might also have to edit the Owners and Members combo box. Just remove the ending ) and add it again.

App On Start – Admins List

In the App On Start, change the e-mail addresses in the Admins list.

And that’s it, you now have an app that you can share with all the employees in your org and they can submit requests for a new Team. FYI – All the teams created with this solution will be private teams. You could give an option to the user to create a public team , however, I don’t think you want that. 😉

Step 5 – Share the SharePoint list with Contribute permission and the Power App with your whole organization (search for “Everyone except external users”).

Here is a demo of the whole solution.

Solution Demo Video

8 thoughts on “Provision Teams using Power Apps and Power Automate

    1. The HTTP with Azure AD connector is a premium connector. If you don’t have a premium license, you can get a Power Apps Community plan and install this flow in the community plan environment where you can use any Premium connectors. FYI – Community plans should only be used for testing purpose. To run it in production, you will need one per user license for Power Automate (as of March 31, 2020)

      Thanks for pointing this out, I have updated the blog post with this information.

      Like

  1. Hi API Guy,

    When running this i get an Odata.Bind error on the creation flow at the Invokte HTTP request – Create Group section:

    The value of ‘odata.bind’ property annotation is an empty array. The ‘odata.bind’ property annotation must have a non-empty array as its value.

    Also in the PowerApp i’m getting an error on the Owners dropdown saying i do not have permission to use this lookup, is that at and admin error that i need to get more privileges adding to the account running it? i’ve have tried re-adding the connection and also the tutorial deleting the code line and and readding it, but still get the same error.

    Like

  2. Hi API Guy,

    When running this i get an Odata.Bind error on the creation flow at the Invokte HTTP request – Create Group section:

    The value of ‘odata.bind’ property annotation is an empty array. The ‘odata.bind’ property annotation must have a non-empty array as its value.

    Also in the PowerApp i’m getting an error on the Owners dropdown saying i do not have permission to use this lookup, is that at and admin error that i need to get more privileges adding to the account running it? i’ve have tried re-adding the connection and also the tutorial deleting the code line and and readding it, but still get the same error.

    Thanks

    Like

    1. Hi. Do you have the admin permissions on your tenant?
      Regarding the PowerApp showing an error , can you try creating a new app , adding the office 365 users connection and then adding a combobox with same code as the Owners Items. Does that also end up in error?

      Like

  3. Hi,

    Using the flow group is created and users got added to group. but when it is trying to create team using group id, am getting below error.

    Error: Failed to execute MS Graph backend request GetGroupInternalApiRequest. The server failed to respond correctly.

    Can i know why am getting this error and resolution for this.

    Thanks

    Like

  4. Awesome work!
    I’m not sure if I’m the only one getting the error, but the first Flow errors out on the “Add a field to the default view” Step.

    Method: Post
    Uri: _api/web/Lists/getByTitle(‘TeamsRequests’)/views/GetByTitle(‘All%20Items’)/ViewFields/AddViewField(‘@{items(‘Add_created_fields_to_the_default_view’)}’)
    Rest is empty.

    The error says: the view isn’t valid (translated from german).

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s