cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mhorn30
Advocate I
Advocate I

Create a Flow to add members to Teams site based on data in a table

I want to create a Flow to add members to a Teams site based on data in a table (i.e. the member's email address and the Team ID (amongst other data) will be in a table, as not every member is added to the same Teams site)

 

The Teams site will be created manually before the Flow is activated for the first time to add the members.

 

mhorn30_0-1601465759223.png


Where do I find the "Team ID" that I need to add in the Flow? (Clicking on "Get link to team" inside my team provides me with a long URL that contains a "groupId", will it be this?)

 

And I assume the "user AAD ID" is the email address of the user? (All users are inside the tenant, i.e. no guests).

Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
mhorn30
Advocate I
Advocate I

So to answer my own question:

 

1. The Team ID is the "groupId". You can find this by clicking on the ellipse next to your Teams site and choosing "Get link to team". Copy the id (numbers) after "groupId=" and  before "&tenantId="

mhorn30_0-1601481288825.png

 

2. The "user AAD ID" is the email address of the user associated with the tenant (i.e. xxxx@company.com)

 

View solution in original post

5 REPLIES 5
mhorn30
Advocate I
Advocate I

So to answer my own question:

 

1. The Team ID is the "groupId". You can find this by clicking on the ellipse next to your Teams site and choosing "Get link to team". Copy the id (numbers) after "groupId=" and  before "&tenantId="

mhorn30_0-1601481288825.png

 

2. The "user AAD ID" is the email address of the user associated with the tenant (i.e. xxxx@company.com)

 

anubhav247
Helper I
Helper I

For all future visitors it might help....

 

I tried writing just the email id for "user AAD ID" which gave me error "user does not exist".

 

So here is what i did insteadimage.png

johnnyshield
Advocate II
Advocate II

I had to use a different method to solve the issue of "user not found". Teams AAD ID emails only seems to like lowercase emails, so I converted them with expression toLower(email). I don't know if the "Get User Profile" step is still needed.

johnnyshield_0-1625006051293.png

 

HWib
Advocate II
Advocate II

It seems like you have to use the Get User Profile as @anubhav247  mentioned.

The user AAD has to match with what's in AAD.

So if in AAD it's lower case, it will have to be in lower case.

if in AAD it's upper case, it will have to be in upper case.

Get user profile, Mail will pull up whatever is registered. I tried the lower case expresssion and gets an error. But working when I use the get user profile Mail. 

Hope this helps for those who gets similar error.

rohanc
New Member

Thanks all. This solution was definitely the right one for me with a small bit of tweaking: I also had trouble using the email address to get the Profile because, in my organisation, individual users sometimes have more than one email address and sometimes have UPNs that are different to their email addresses.

 

I found an Operation that resolves all these issues:

"Search for users (V2)" instead of using "Get user profile (v2)"

Retrieves the user profiles that match the search term (V2).

Linked here: Office 365 Users - Connectors | Microsoft Docs

 

rohanc_0-1649191393123.png

 

I think this works for everyone, since email addresses should be unique (ie each email address only links to one user, even if it is not the email address for the UPN or even if the UPN has been configured to be something different to the email address).

 

I tried to publish this as a template (so you could just search for the template "Add Member to a Teams Group"), but am not sure if that will be successful.

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Users online (2,209)