I was working recently with Microsoft Teams, where I needed to add members to a particular team in Microsoft Teams automatically using Power Automate.
I will explain how to add a member to a specific team in Microsoft Teams using Power Automate from a SharePoint list. Also, I will show you how to add bulk members to the team site in Microsoft Teams from an Excel spreadsheet using Power Automate.
Then, I will give another example of adding an external member to a team in Microsoft Teams with Power Automate.
Add Members to Microsoft Teams using Power Automate
Microsoft Teams is a part of Microsoft 365 Group. Adding members to the Microsoft Team allows the user to have permission to create a channel, private chat, messages, share a channel, create meetings or access schedules, invite other guests, create teams, etc.
The user should be the Team owner to add members to the Microsoft Teams.
1. Add From a SharePoint list
Now, let’s discuss how to automatically add a member to a particular team in Microsoft Teams from a SharePoint list using Power Automate.
Example:
For this, I have created a SharePoint list named Request Access Form, which comprises the below columns presented in the table:
| Column Name | DataType |
| Team Name [Title column] | Single line of text |
| Member | Person or Group column |

Whenever a user enters an item into the SharePoint list, the flow will trigger, and it will add the member to the Team the user has provided.
Follow the below steps to create the flow.
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 item is created) -> Click Create button.
Set the below details:
- Site Address: Select a specific SharePoint site from the drop-down.
- List Name: Choose a specific SharePoint list from the drop-down menu.

2. After that, add List teams flow action to get all the teams in the Microsoft Teams.
Here, I wanted to retrieve the Team ID for the particular team name that already existed in Microsoft Teams.
To get that, I will add a Condition control action to match the below condition.
| Value | Operator | Value |
| Team Name [From list teams] | is equal to | Title [SharePoint list] |
3. Take Condition control flow action, and provide condition expression like the below:
@{items('For_each')?['displayName']} is equal to @{items('Apply_to_each')?['Title']}For each loop will be added automatically when we take the condition expression.

4. Under, True condition, add Get user profile(v2) flow action to retrieve member details like email address. Provide the user details:
- User(UPN): Select the field -> Take Member Email from the dynamic content.
Then, Apply to each will be added to the True condition as shown below:

5. After that, add an Add member to a team flow action. Configure the required details below:
- A user principal name or AAD ID to add to a: Select User Principal Name from the dynamic content.
- Team: Select Team Id from the dynamic content.

6. Now, it’s time to save the flow. Click on the Save button. Then, select Test. Run the flow Manually. Click on Run flow.
7. Below is the image of the Microsoft Team site having only one member.

8. Go to the SharePoint list and create an item, as shown below.

9. When the flow runs successfully, If there is no existing user, it will add a member to the specific team in Microsoft Teams.
After adding a member to the team, you can see from the below image:

This is how to automatically add a member to a single team in MS Teams with Power Automate.
2. Add From An Excel File
So, now let me show you how to add a list of members to a single team in Microsoft Teams using Power Automate from Excel data.
We need to create an Excel table with the Name and Email address and Team Name as shown below. After that, format the Excel list as a table and save it. The data will be saved in OneDrive.

I need to add the users in the Excel sheet to Microsoft Teams using Power Automate.
Image showing added members in Microsoft Teams:

To achieve this, go through the below steps:
1. Navigate to https://make.powerautomate.com in your browser to open the Power Automate Home page -> click + Create -> Select the Instant cloud flow -> Provide the flow name, and choose the trigger’s flow (Manually trigger a flow) -> Click the Create button.
2. Then, take List rows present in a table flow action to get the values in the Excel sheet. Add the following details:
- Location: Select the location of the Excel data where it is saved from the drop-down.
- Document Library: Choose the document library from the drop-down menu.
- File: Select the file name that you have saved.
- Table: Select a table.

3. To check if the users are present in the organization, add the Search for the user (v2) flow action.
- Search term: Take Email Address from the dynamic content of Excel.

4. Then, take Add member to a team flow action to add the retrieved members from the active directory to the team in Microsoft Teams.
- Team: Select the existing Microsoft Team from the drop-down.
- A user principal name or AAD ID to add to a: Select User Principal Name from the dynamic content.

Once the flow is ready, save and test it manually.
5. Then, you can see the result of the Power Automate flow by adding members to the particular team in Microsoft Teams, as shown in the figure below:

This is how to add bulk members to a team of Microsoft Teams from Excel using Power Automate.
Add External Members to a team in Microsoft Teams using Power Automate
You can also add external members to a team in Microsoft Teams using Power Automate.
Here, I have created a Microsoft Form with the below columns:
- External User Name
- Email Address

In that form, I have enabled the Microsoft Forms settings to allow Anyone can respond, so that members outside the organization can submit the response without signing into a Microsoft account.

Note:
One should have the Site owner’s permission to add the external user to the Microsoft Team site.
As well as, you should need to set the sharing settings to Anyone for that particular site at the site level.
- Go to the SharePoint admin center with https://tenant name -admin.sharepoint.com
- Expand Sites -> Select Active sites.
- Select a Specific SharePoint site from the Active sites page.
- Click Settings -> Choose Anyone in External file sharing.

Now, let us see how to create the flow using Power Automate.
1. Open the Power Automate Home page -> Click +Create -> Select Automated cloud flow -> Give a flow name and choose a trigger [When a new response is submitted] -> Click the Create button.

2. Add a new step taking the ‘Get response details‘ flow action to retrieve the responses submitted in the Microsoft Forms.
Give the below details:
- Form Id: Select the Microsoft Form that you have created.
- Response ID: Take the Response Id from the dynamic content.

3. Then, add a Compose flow action to provide the replace() expression. Place the below expression in the Inputs section.
Here, I was replacing @ in the Email Address with ‘_’ to get the format of the external user.
Inputs: Click Expression -> Give the below code.
replace(outputs('Get_response_details')?['body/re9456f4f80af4809bfb2f7334598eb70'],'@','_')After that, Click OK.

4. Next to that, add the Create user flow action from the Microsoft Entra connector.
Set all the following details in it.
Important
You need to have Global Admin access to create a external user in the Azure active directory.
- Account Enabled: Select Yes from the drop-down.
- Display Name: Take the External User Name column from the dynamic content.
- Mail Nickname: Enter a nickname for a user.
- Password: Set a strong password.
- User Principal Name: Take outputs of compose along with the code below.
outputs('Compose')#EXT#@szg52.onmicrosoft.com
5. Add a Delay flow action to stop the flow for one minute because it will take a few seconds to create the user.
Set the delay action:
- Count: Take the count as 1 manually.
- Unit: Select ‘Minute‘ from the drop-down.
I included this mainly because the flow is running into error, but it creates and adds users to Microsoft Teams.

6. In the final step, take “Add member to a team” flow action and set the properties.
- Team: Select a Microsoft Team to which you need to add an external member.
- A user principal name or AAD ID to add to a: Take Id column from the Create user of dynamic content.

7. When the flow is created Save and run the manually. Click on Save -> Select Manually radio button in the test flow window -> Select Runflow.
8. Now, submit a response in the Microsoft Form [Interior Design Team] with Name and Email Address as shown below:

9. If no existing user exists, the flow runs successfully, creates a user in the Azure Active directory, and adds that particular user to the specific team of Microsoft Teams.


10. If the user is already there in the Azure active directory, Create user fails, and the flow gives an error as shown below:

This is how to add an outside member to the team site of Microsoft Teams using Power Automate with the help of Microsft Forms.
Conclusion
In this tutorial, I have explained how to add a member to a team in Microsoft Teams using Power Automate.
You may also like:
- How to Create a Team using Power Automate in Microsoft Teams?
- How to Schedule Meetings in Microsoft Teams using Power Automate?
- How to Send Teams Messages using Power Automate?
- How to Use Microsoft Copilot in Power Automate?

After working for more than 18 years in Microsoft technologies like SharePoint, Microsoft 365, and Power Platform (Power Apps, Power Automate, and Power BI), I thought will share my SharePoint expertise knowledge with the world. Our audiences are from the United States, Canada, the United Kingdom, Australia, New Zealand, etc. For my expertise knowledge and SharePoint tutorials, Microsoft has been awarded a Microsoft SharePoint MVP (12 times). I have also worked in companies like HP, TCS, KPIT, etc.