Power Platform : Power Automate – Create a Team in Teams using Power Automate.

.
Do more of what makes your soul happy 🙂
.
Hello Everyone,
Hope you all are doing well.
Today in this article I am going to discuss about how to create a team in Teams using Power Automate.
Also we have good number of articles on Power Platform, please have a look.
https://knowledge-junction.in/category/technology-articles/power-platform/
So without getting late, lets get started.
Background
In one of our project requirement is create a team in Teams using Power Automate. For testing purpose we prepared a Power Automate Instant flow with manual trigger. The flow check existing teams and avoid creation of duplicate teams on Tenant. If the Teams don’t have team with same Team Name then it create a team in Teams and also send mail to user.
Introduction
Power Automate:
Power Automate is a service that helps us create automated workflows between our favorite apps and services to synchronize files, get notifications, collect data, and more.
- Automate business processes
- Send automatic reminders for past due tasks
- Move business data between systems on a schedule
- Connect to more than 500 data sources or any publicly available API
- We can even automate tasks on our local computer like computing data in Excel.
Instant Flow:
Instant Flows allow us to start a flow with a click of a button, and can be used across desktop or mobile devices. They are commonly used to automate a wide range of tasks such as requesting an approval in Teams or SharePoint or sending a reminder to the team with a push of a button from mobile.
Microsoft Teams:
Microsoft Teams is the ultimate messaging app for our organizations—a workspace for real-time collaboration and communication, meetings, file and app sharing, and even the occasional emoji! All in one place, all in the open, all accessible to everyone.
Team in Microsoft Teams:
In Microsoft Teams, teams are groups of people brought together for work, projects, or common interests. Teams are made up of two types of channels — standard (available and visible to everyone) and private (focused, private conversations with a specific audience).
Create a Flow
High Level Steps:
Create instant flow in Power Automate.
Add Steps: Choose an operations and actions.
Checking existing team names on Teams with our Team Name which we are going to create.
Condition for creating new Team in Teams.
Create Team, Send mail and Terminate flow.
Detailed Steps:
- Go to office.com, and sign in to our M365 account – https://www.office.com/?auth=2
- Launch Power Automate from Office365 app launcher.

- In Power Automate Click on Create and select Instant Cloud flow.

- Give the Flow name and Choose Trigger and then click on Create.

- Our flow opened with manually trigger action. Click on New step to add next action.

- Choose an operation Microsoft Teams and select action List teams.

- Click on 3 dots (…) of list teams action , here we can see the properties of the action.
- We can copy the action to clipboard to re use it, Rename the action, Add a note in the action, Settings of the action, Peak code of the input/output in the action, and delete the action.
- For every action in the flow we have these properties.
- The action List teams – Get the list of all Teams in a Tenant.
- Rename the action and click on New step.

- Choose an operation Variable and select action Initialize variable.

- The action Initialize Variable – Initializing the variable for teams and will use in Next steps.
- Name the variable and type String. Click on Next step.

- Choose an operation Variable and select action Set variable.

- Use the above initialized variable (varTeam) in Name and select the value from the dynamic content Team Name.
- Now it form a loop and applies to each Team in a Tenant.
- The action Set Variable – Give the Team Name.
- The loop (Apply to each) – Check all Team Names in a Tenant.
- Click on Next step.

- Choose an operation Control and select action Condition.

- In this condition choose first value varTeam from dynamic content. In varTeam we have all Team names.
- Choose second value as our Team Name (to be create).
- Here use Expression is equal to from the drop down in the condition.
- The action Condition – Check Team Names in a Tenant with Our Team Name (to be create).

- The action Condition have Yes / No conditions.
- If the condition is true it goes in Yes condition or false it goes in No condition.
- If the condition is true means that our Team Name (to be create) already exists on Tenant. Notify the same with User through mail.
- In Yes condition, choose an operation Office 365 Outlook and action Send an email (V2).

- Give the mail details: To address (take it from dynamic content / give manually), Subject and Body of the mail as shown below. And click on Add an action.

- Choose an operation Control and action Terminate.

- Use Status of the Terminate as Succeeded.
- The action Terminate – Stop the flow after success of all the actions.

- If the condition result is false means that Our Team Name is not existing on Tenant.
- So, we can create our Team on Tenant.
- In No condition, choose an operation Microsoft Teams and action Create a team.

- Give the Team details: Name, Description and Visibility. And click on Add an action.

- Choose an operation Office 365 Outlook and action Send an email (V2).

- Give the mail details: To address (take it from dynamic content / give manually), Subject and Body of the mail as shown below. And click on Add an action

- Choose an operation Control and action Terminate.

- Use Status of the Terminate as Succeeded.
- The action Terminate – Stop the flow after success of all the actions.

- Now Save the flow and click on Test.

- Select Test the Flow Manually and click on Test.

- Review/add the connections and actions and click on Run flow.

- Now the flow run started and click on Done.

- Here we can see the flow ran successfully and the Expression result is false.
- So, as per our condition flow create the team in our Tenant and send mail.
- Now the flow Terminates here.

- We got a mail regarding Team creation.

- In our Tenant we can see the Team created.

- Now we test the flow again with the same Team Name.
- Here we can see the flow ran successfully and the Expression result is true.
- So, as per our condition flow didn’t create the team in our Tenant and send mail to User.
- Now the flow Terminates here.

- We got a mail regarding Team already exists.

.
Hope this article will help us to create a team in Teams using Power Automate.
Also get my article updates on my social media handles.
LinkedIn – https://www.linkedin.com/in/khasim-shaik-8784a1232/
Twitter – https://twitter.com/KhasimShaik2009
Facebook – https://www.facebook.com/profile.php?id=100078255554660
Thank you for your support, will catch up with new article soon.
Keep learning and keep smiling.
Have a great day.
Thanks.
2 Responses
[…] https://knowledge-junction.com/2022/07/22/power-platform-power-automate-create-a-team-in-teams-using… […]
[…] https://knowledge-junction.com/2022/07/22/power-platform-power-automate-create-a-team-in-teams-using… […]
You must log in to post a comment.