How to Create a Team using Power Automate in Microsoft Teams?

Recently, I was working with Microsoft Teams where I got a requirement to create a team in Microsoft Teams using Power Automate.

The user will submit the team creation request using Microsoft Forms, and then the flow will trigger to create a team using Power Automate in MS Teams. Also, it should not create any duplicate team in Microsoft Teams.

Here is the complete flow:

  • Create a Microsoft Form that will be used by the users to submit Teams details like name, description, etc.
  • The flow will first save the MS forms response to a SharePoint list. To prevent duplicate creation of teams, first we will save the responses to a SharePoint list, where the Team name column in the list has unique values enabled. The list will not allow to enter duplicate values and if so, our flow will send an email to the requester. Otherwise, it will create a team in Microsoft Teams using the Team name and description.

The Power Automate flow with various actions looks like below:

create team using power automate

What is a team in Microsoft Teams?

A team in Microsoft Teams is a collection of people who are brought together for collaboration and communication purposes within an organization. It’s designed to facilitate a group that works closely to accomplish tasks or manage projects. It can also integrate with other Office 365 apps like Power Automate, SharePoint, Power BI, Planner, MS Word, PowerPoint, etc.

Teams within Microsoft Teams serve as the central hub for workplace conversations, collaborative teamwork, video chats, and document sharing, all aimed at improving productivity for group members.

Within a team, you can have multiple channels, which are dedicated sections within the team to keep conversations organized by specific topics, projects, or disciplines.

Channels can be standard (open to all team members) or private (focused on discussions that should be visible to only a select group of members). Each channel is built around a topic like “Marketing” or “Project Delta,” making it easy to find conversations and to work on specific tasks with your team members.

Creating teams in Microsoft Teams will directly create a SharePoint team site.

Create a Team in Microsft Teams using Power Automate

The user will submit the Team creation request using a Microsoft Form. So before creating the flow, let us first create a Microsoft Form.

Create a Microsoft Form

First, I will begin with creating a Microsoft Form. To create a new Microsoft Form, go through the below steps:

  • Click on App Launcher.
  • Select Explore all your apps.
  • Choose and select Forms from the Apps window.
  • Click on +New form to create a new form in the Microsft Forms.
  • Inside the Microsoft Form, Provide the Title and add details like the Requested Team Name and Team Description, as shown in the image below.
create a team with power automate

Save the form and the form will be available for us while creating the flow.

Add Microsoft Forms response to the SharePoint list

We will save the form responses to a SharePoint Online list to prevent duplicate teams.

Create a SharePoint Online list named Teams Creation Request Form with similar details and datatypes.

You can see the image of the SharePoint list below.

Column NameDatatype
Requested Team NameSingle line of text
Team DescriptionA single line of text
create microsoft team with power automate

After that, to avoid the duplicate creation of teams from the SharePoint list items, enforce the unique values in the SharePoint list column named Requested Team Name.

Follow the instructions to do:

  • Select SharePoint column header [Requested Team Name].
  • Choose Column settings -> Click on Edit.
  • In the Edit column, Click More options.
  • Toggle the Enforce unique values button to Yes.
  • Then, Select Save.
create teams using power automate

Create teams in Microsoft Teams using SharePoint list

Now, follow the below steps to create teams from Microsoft Teams using the SharePoint list item values in Power Automate.

1. Open the Power Automate home page in your browser, click + Create -> Select the Automated cloud flow -> Provide the flow name, and choose the trigger’s flow (When a new response is submitted) -> Click Create button.

  • Form Id: Select the Microsoft Form you created from the drop-down.
create ms teams using power automate

2. Then, add the Get response details flow action to retrieve the responses submitted in the Microsft Form.

Give the following details:

  • FormId: Select value from the drop-down menu.
  • Response Id: Click the field -> Take Response Id from the dynamic content.

Then, For each loop will be added automatically.

Create a Team in Microsoft Teams using Power Automate

4. After that, add a Create item flow action to save the responses from Microsoft Forms to the SharePoint list.

Ensure to give the required details below:

  • Site Address: Select a specific SharePoint site from the drop-down.
  • List Name: Choose a specific SharePoint list from the drop-down menu.

Next, click the Show all button of Advanced parameters to display all the SharePoint list columns.

  • Requested Team Name: Take the ‘Requested Team Name‘ value from the dynamic content.
  • Team Description: Take the value of Team Description from dynamic content.

Refer to the image below:

create team using power automate

Before going to the next step, we need to check conditions like:

1. If the creation of SharePoint list item failed [Due to duplicate teams name] -> Create item action errored => The Requested Team Name already exists => Send email to the responder.
2. If the SharePoint list item is created, the Create item action succeeded => Then, create the teams in Microsoft Teams with the Requested Team Name.

5. So, add Send an email(V2) flow action. This flow action will work if the creation of an item has failed.

  • Click the Settings menu.
  • Click on the Run After drop-down.
  • Expand Create item.
  • Unselect ” Is successful” and select ” Has failed.

You may observe that the arrow on the “Has failed” side will displayed with a red dot.

create a team with power automate

6. In the Send an email(v2) action, configure the below details:

  • To: Give the Responder’s Email from the dynamic content.
  • Subject: Give a subject line that summarizes the content of the email.
  • Body: Provide a detailed email description of the mail.
create microsoft team with power automate

In the same step, select Add a parallel branch to run the actions side-by-side.

7. On the other side, add the Create a team flow action to create teams in Microsoft Teams.

Provide the below details:

  • Team Name: Take the Requested Team Name from the dynamic content.
  • Description: Add Team Description from the dynamic content.
How to create teams in Microsoft Teams using Power Automate

8. Then, add one more Send an email(V2) flow action to notify the responder about the successful creation of teams in Microsoft Teams.

Provide the following details:

  • To: Give the Responder’s Email from the dynamic content.
  • Subject: Enter a subject line for the email.
  • Body: Give the description to the mail.
create teams using power automate

9. Now, it’s time to save the flow. Click on the Save button. Then, select Test. Run the flow Manually. Click Runflow.

10. At this point, add a response in the Microsoft Form and submit it as shown in the image below:

create ms teams using power automate

11. If there is no duplicate team name, the new teams will be created in the Microsoft Teams Environment as shown below:

create team using power automate

12. If there is a duplicate Team name, then it will not create an item in the SharePoint list. Then, the create item action will give an error and email the responder about rejecting team creation in Microsoft Teams.

Refer to the image below:

create a team with power automate
create microsoft team with power automate

This is how to create a team with Power Automate in Microsoft Teams.

Conclusion

It is easy to create a team using Power Automate for Microsoft Teams. Here, I explained in detail how to create a Microsoft team with Power Automate.

In the above complete example, the user will submit the team creation request using a Microsoft form, and then the flow will trigger and create a team in Microsoft Teams.

You may also like:

>