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

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

  1. Hello, thanks so much for the great solution! I am adapting it to fit my firm’s needs and we need to pull in the “Team name” field from a sql table backend so the user selects an existing client name/ID rather than typing it in (prone to user error). So I was able to change the field to use the sql data source no problem, but my issue is that I need the team name to be a combination of the client name and Client ID # such as “Client ABC 123456”. In my experience I would push this info to a sharepoint list with a flow and could edit said flow to pull in both the client name and client ID variables with a space between no problem.. I’m just not sure how you are pushing this data to the sharepoint list so I can edit the Team name parameter/variable to include what i need, if you could expand on that, that would be very helpful!

    Eric

    1. Edit: for anyone who stumbles upon what I said. You ultimately just need to change the teamname data card update value to a label field which includes whatever info you need for the team name.

      Eric

  2. This is a great solution – thank you very much!
    After I installed it recently, it worked well and created a Team.
    Now I want to use it again and get an error of the action “Invoke an HTTP request – Put a team for the created group”.
    The group is created properly.

    Error Details:
    Failed to execute MS Graph backend request GetGroupInternalApiRequest. The server failed to respond correctly. Response Code: NotFound, Reason: Reason: Not Found, Correlation headers: request-id: a6c54fc0-e486-4e30-b026-162003db8dff
    client-request-id: a6c54fc0-e486-4e30-b026-162003db8dff
    x-ms-ags-diagnostic: {“ServerInfo”:{“DataCenter”:”UK South”,”Slice”:”SliceC”,”Ring”:”4″,”ScaleUnit”:”002″,”RoleInstance”:”AGSFE_IN_8″}}
    Date: Thu, 17 Sep 2020 07:49:17 GMT

    Any hint would be fine.
    Thanks

    1. Found a solution: Replaced the “Invoke an HTTP request” by a “HTTP” action (green).
      Previously I have setup permissions for graph API as described here by Nanddeep Nachan:
      https://www.c-sharpcorner.com/article/calling-graph-api-from-power-automate-flow/
      Now the flow creates the Teams properly.

      Probably in the future there is no need to use graph for creating the Team: There are some new actions for Teams, including to create a team.

      1. hello Josef

        how did you fix it? i have replaced the Invoke by a “regular” HTTP with the same value but leaving the Cookies portions empty but now i am getting “Access token empty” any help would be highly appreciated… i was like able to run it successfully only once

  3. in the flow, you need to change the view url. My site is in french so it’s tous les éléments.aspx instead of allitems.aspx
    So probably you need to change “allitems.aspx” to german, in flow

    Great tutorial, i got it working ! I can’t wait for easier deployment by microsoft

    1. Thank you. Apologies, didn’t realize that language change could have such implications. Thank you for pointing this out.

  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).

  5. 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

  6. 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

    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?

  7. 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.

    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.

Leave a Comment

%d bloggers like this: