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:

Microsoft 365: Power Automate
Fig: Microsoft 365: Power Automate
  • In Power Automate Click on Create and select Instant Cloud flow.
Microsoft 365: Power Automate - Create Instant flow
Fig: Microsoft 365: Power Automate – Create Instant flow
  • Give the Flow name and Choose Trigger and then click on Create.
Microsoft 365: Power Automate – Create flow
Fig: Microsoft 365: Power Automate – Create flow
  • Our flow opened with manually trigger action. Click on New step to add next action.
Microsoft 365: Power Automate – New step
Fig: Microsoft 365: Power Automate – New step
  • Choose an operation Microsoft Teams and select action List teams.
Fig: Microsoft 365: Power Automate – List teams action
Fig: Microsoft 365: Power Automate – List teams action
  • 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.
Microsoft 365: Power Automate – action properties
Fig: Microsoft 365: Power Automate – action properties
  • Choose an operation Variable and select action Initialize variable.
Microsoft 365: Power Automate – Initialize variable action
Fig: Microsoft 365: Power Automate – Initialize variable action
  • 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.
Microsoft 365: Power Automate – Initialize variable details
Fig: Microsoft 365: Power Automate – Initialize variable details
  • Choose an operation Variable and select action Set variable.
Microsoft 365: Power Automate – Set variable action
Fig: Microsoft 365: Power Automate – Set variable action
  • 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.
Microsoft 365: Power Automate – Set variable details
Fig: Microsoft 365: Power Automate – Set variable details
  • Choose an operation Control and select action Condition.
Microsoft 365: Power Automate – Condition action
Fig: Microsoft 365: Power Automate – Condition action
  • 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).
Microsoft 365: Power Automate – Condition action details
Fig: Microsoft 365: Power Automate – Condition action details
  • 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).
Microsoft 365: Power Automate – Send an email (V2) action (in Yes condition)
Fig: Microsoft 365: Power Automate – Send an email (V2) action (in Yes condition)
  • 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.
Microsoft 365: Power Automate – details of Send an email (V2) action (in Yes condition)
Fig: Microsoft 365: Power Automate – details of Send an email (V2) action (in Yes condition)
  • Choose an operation Control and action Terminate.
Microsoft 365: Power Automate – Terminate action (in Yes condition)
Fig: Microsoft 365: Power Automate – Terminate action (in Yes condition)
  • Use Status of the Terminate as Succeeded.
  • The action Terminate – Stop the flow after success of all the actions.
Microsoft 365: Power Automate – details of Terminate action (in Yes condition)
Fig: Microsoft 365: Power Automate – details of Terminate action (in Yes condition)
  • 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.
Microsoft 365: Power Automate – Create a team action (in No condition)
Fig: Microsoft 365: Power Automate – Create a team action (in No condition)
  • Give the Team details: Name, Description and Visibility. And click on Add an action.
Microsoft 365: Power Automate – details of Create a team action (in No condition)
Fig: Microsoft 365: Power Automate – details of Create a team action (in No condition)
  • Choose an operation Office 365 Outlook and action Send an email (V2).
Microsoft 365: Power Automate – Send an email (V2) action (in No condition)
Fig: Microsoft 365: Power Automate – Send an email (V2) action (in No condition)
  • 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
Microsoft 365: Power Automate – details of Send an email (V2) action (in No condition)
Fig: Microsoft 365: Power Automate – details of Send an email (V2) action (in No condition)
  • Choose an operation Control and action Terminate.
Microsoft 365: Power Automate – Terminate action (in No condition)
Fig: Microsoft 365: Power Automate – Terminate action (in No condition)
  • Use Status of the Terminate as Succeeded.
  • The action Terminate – Stop the flow after success of all the actions.
Microsoft 365: Power Automate – Terminate action details (in No condition)
Fig: Microsoft 365: Power Automate – Terminate action details (in No condition)
  • Now Save the flow and click on Test.
Microsoft 365: Power Automate – Save flow and Test
Fig: Microsoft 365: Power Automate – Save flow and Test
  • Select Test the Flow Manually and click on Test.
Microsoft 365: Power Automate – Test flow manually
Fig: Microsoft 365: Power Automate – Test flow manually
  • Review/add the connections and actions and click on Run flow.
Microsoft 365: Power Automate – Run flow
Fig: Microsoft 365: Power Automate – Run flow
  • Now the flow run started and click on Done.
Microsoft 365: Power Automate – flow run started
Fig: Microsoft 365: Power Automate – flow run started
  • 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.
Microsoft 365: Power Automate – flow run successfully (with No condition)
Fig: Microsoft 365: Power Automate – flow run successfully (with No condition)
  • We got a mail regarding Team creation.
Microsoft 365: Power Automate – mail regarding Team creation
Fig: Microsoft 365: Power Automate – mail regarding Team creation
  • In our Tenant we can see the Team created.
Microsoft 365: Power Automate – Team created in Teams
Fig: Microsoft 365: Power Automate – Team created in Teams
  • 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.
Microsoft 365: Power Automate – flow run successfully (with Yes condition)
Fig: Microsoft 365: Power Automate – flow run successfully (with Yes condition)
  • We got a mail regarding Team already exists.
Microsoft 365: Power Automate – mail regarding Team already exists
Fig: Microsoft 365: Power Automate – 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.

Khasim Shaik

SharePoint & Power Platform Developer at OS InfoTech

You may also like...

2 Responses

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: