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!

/uploads/2020/03/image-8.png?w=1024

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

/uploads/2020/03/image-6.png?w=598

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.

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

/uploads/2020/03/image.png?w=710

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.

/uploads/2020/03/image-1.png?w=570

/uploads/2020/03/image-3.png?w=1024

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.

/uploads/2020/03/image-2.png?w=705

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

/uploads/2020/03/image-4.png?w=669

/uploads/2020/03/image-5.png?w=682

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.

https://videopress.com/v/KZIMqDpd?preloadContent=metadata

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

https://videopress.com/v/D22Ts6ET?preloadContent=metadata

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. šŸ˜‰

Here is a demo of the whole solution.

https://videopress.com/v/v56if32T?preloadContent=metadata

Steven -

Hello ApiGuy, When importing the second package. I get this error:The user ‘6xxxx2’ does not have a service plan adequate for the non-Standard connection. https://go.microsoft.com/fwlink/?linkid=2123710 However I use none premium connectors. I’m afraid this might again be a licencing issue? Greetings


#### [That API Guy]( "") -

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.


#### [AJMDRP85]( "[email protected]") -

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.


#### [ajmdrp85]( "[email protected]") -

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


#### [That API Guy]( "") -

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?


#### [Vamshi Krishna Budarapu](http://vamshikrishnabudarapu.wordpress.com "[email protected]") -

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


#### [Microsoft Teams Provisioner with the Power Platform – Power Community](https://dynamics365society.uk/archives/microsoft-teams-provisioner-with-the-power-platform/ "") -

[ā€¦] Vivekā€™s Blog Post: https://thatapiguy.tech/2020/03/27/provision-teams-using-power-apps-and-power-automate/ [ā€¦]


#### [Sebe]( "[email protected]") -

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


#### [jeffangama](http://jeffangama.wordpress.com "[email protected]") -

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


#### [Tyler Duncan]( "[email protected]") -

Did you use Type Person for the Owners and Members in the SharePoint List?


#### [Tyler]( "[email protected]") -

What about in cases when there are no members to add?


#### [Josef Steiner](https://www.plan-c.de/ "[email protected]") -

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


#### [Josef Steiner]( "[email protected]") -

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.


#### [That API Guy]( "") -

Yes, that’s right. I used the person type.


#### [That API Guy]( "") -

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


#### [mag1c22]( "[email protected]") -

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


#### [mag1c22]( "[email protected]") -

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


#### [jeremy]( "[email protected]") -

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


Did this article help youā“

Subscribe to get more Power Platform articles directly in your inbox