cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
LynnS
Frequent Visitor

Exporting a list of Team members: where do I find the Team's ID?

I want to export a list of email addresses for all members of a Microsoft Team, so I can email them (we need the email to be sent to the individual inboxes, not to the Team channel). Although this seems like a very basic function, apparently I have to use Power Automate to do it. I've got as far as Manually trigger a flow, then Choose an action. In Azure AD I can see an option to Get Group Members. If this is the option I need, I fail at the next step, which requires me to enter the group ID. I have no idea where to find the group ID for a Teams group. Can anybody point me in the right direction, please? I'm not a technical admin - I don't use any of the AD backend functions, or PowerShell. I just a simple way of getting the ID.

1 ACCEPTED SOLUTION

Accepted Solutions
QPatterson
Regular Visitor

Hiya,

 

Totally agree that this is a super roundabout way of doing this but I couldn't figure any other way to do it either... I did figure out a way to write the emails to a spreadsheet though!

 

Step 1: Create a spreadsheet and save it somewhere in a teams group you have access too. You'll need to create a table within the spreadsheet for the flow to recognise (I helpfully called mine 'Table1'), and you'll want to have two columns, one as a dummy column for looping, the other to record the email addresses. For example, below I've called my dummy column 'Count', and my value column 'Email'. I've filled the Count column with 1s which I'll explain in the next step. Importantly, you'll want the number of rows in the table to be greater than or equal to the number of emails/members in your teams group.

 

QPatterson_0-1625559837423.png

 

Step 2: Add a 'Update a row' step to your flow (excel). Point the flow to your spreadsheet from step 1, and tell it to look at the table from step 1. The key column and key value are the lookup parameters that tell the flow what row it's going to update. Crucially, when there are repeat key values in the key column, it will just update the first one, which we want to use to our advantage so we can add the email addresses to different rows each time without overwriting the value each time.

Put the key column as 'Count' and the key value as '1', then in the Email slot click 'add dynamic content' and select 'Mail'. At this stage, Flow should insert an 'Apply to each' box outside our Update row box so that our update row happens for each email address in the list we got in the previous step, awesome! The last thing we need to do is to change the '1' value in our count column so that on the next email in the loop it looks past the entry we just updated and instead updates the next row. I tried at first just changing the 1 to 2 (so I put '2' in the Count box in the screenshot below) but the flow didn't like the fact it was inserting duplicate values in the Count column (even though there were already duplicate values to begin with) so it failed after the second step of the Apply to each loop. Instead I just put in a corresponding random bit of unique info from the list of group members (in this case the display name, but you could just put the email in the Count column as well) to ensure that we're getting rid of the 1 so the same row isn't updated twice, and we're not inserting any duplicate values into the Count column. 

 

QPatterson_1-1625560053307.png

 

This ended up working for me, the flow took about a minute to run, but I ended up with all of the emails listed in a table! Just make sure that you have more rows in the pre-prepared table than emails, otherwise it will run out of space in the table to write all the emails. Make sure as well to set the number of entries loaded into the list to 999 in the get emails step to catch all of them, the default value is 100. Not sure what to do if you have more than 999 emails, maybe try running the flow a few times with a different sorting function each time to grab them in sections?

 

Let me know if you have any questions 🙂

View solution in original post

14 REPLIES 14
efialttes
Community Champion
Community Champion

Hi!

So you at least have the Team's name and you are one of its members, right?

If so, please note every TEams has an Office 365 group behind

So I would add 'Office 365 group' 'List group members' action block and select my target team from the drop down menu:

Flow_TeamMembers_1.png

 

This action block will provide you an array of object, each object represents a member of the Team. Some useful attributes inside: email, Name, etc.

Hope this helps

Did I make your day? If so, mark my response as 'Solution' !!!

También escribo sobre Power Automate en este Blog y en Twitter

Thank you @efialttes - I was looking in the wrong place. I started by searching for 'members' within the Teams option, but drew a blank. Then I did a global search, and the first likely option was Azure AD - 'get team members'. Selecting that option doesn't give you a drop-down list of teams - you have to manually enter a team ID, hence my confusion.

 

The flow has run correctly. Now I need to figure out where the data has been exported to!

So, what do you need exactly? A list with email addresses?

Thanx!

Did I make your day? If so, mark my response as 'Solution' !!!

También escribo sobre Power Automate en este Blog y en Twitter

Yes, exactly that

Anonymous
Not applicable

Did you ever find the data? I'd like to export the data to a spreadsheet from the flow. Is that possible?

 

Hi ! How do you configure the List group members action to get all of the members? Default is 100, but when you set (increase) the top to retrieve more, it still only brings a subset, not all of them.

 

Thx

Gustavo

@Gbubu havent tested myself Tems with more than 100 members, but according to your description seems there is a limitation in either the API call, or the way the connector is implemented.
You always get 100, no matter the value assigned as the top value?
It happens in other connectors also, Planner also has a limit and cannot read more than 400 tasks

The good news  for your use case are, you can obtain up to 1000 members of a Team, according to the Office 365 connector documentation. Just remember to activate pagination under 'Settings':

List group members

This operation returns a list of all members in the given group and their details such as name, title, email, etc. You can query up to 1000 items using Top parameter. In case you need to retrieve more than 1000 values please turn on Settings->Pagination feature and provide Threshold limit.

Not in my laptop, unable to test

 

Did I make your day? If so, mark my response as 'Solution' !!!

También escribo sobre Power Automate en este Blog y en Twitter

QPatterson
Regular Visitor

Hiya,

 

Totally agree that this is a super roundabout way of doing this but I couldn't figure any other way to do it either... I did figure out a way to write the emails to a spreadsheet though!

 

Step 1: Create a spreadsheet and save it somewhere in a teams group you have access too. You'll need to create a table within the spreadsheet for the flow to recognise (I helpfully called mine 'Table1'), and you'll want to have two columns, one as a dummy column for looping, the other to record the email addresses. For example, below I've called my dummy column 'Count', and my value column 'Email'. I've filled the Count column with 1s which I'll explain in the next step. Importantly, you'll want the number of rows in the table to be greater than or equal to the number of emails/members in your teams group.

 

QPatterson_0-1625559837423.png

 

Step 2: Add a 'Update a row' step to your flow (excel). Point the flow to your spreadsheet from step 1, and tell it to look at the table from step 1. The key column and key value are the lookup parameters that tell the flow what row it's going to update. Crucially, when there are repeat key values in the key column, it will just update the first one, which we want to use to our advantage so we can add the email addresses to different rows each time without overwriting the value each time.

Put the key column as 'Count' and the key value as '1', then in the Email slot click 'add dynamic content' and select 'Mail'. At this stage, Flow should insert an 'Apply to each' box outside our Update row box so that our update row happens for each email address in the list we got in the previous step, awesome! The last thing we need to do is to change the '1' value in our count column so that on the next email in the loop it looks past the entry we just updated and instead updates the next row. I tried at first just changing the 1 to 2 (so I put '2' in the Count box in the screenshot below) but the flow didn't like the fact it was inserting duplicate values in the Count column (even though there were already duplicate values to begin with) so it failed after the second step of the Apply to each loop. Instead I just put in a corresponding random bit of unique info from the list of group members (in this case the display name, but you could just put the email in the Count column as well) to ensure that we're getting rid of the 1 so the same row isn't updated twice, and we're not inserting any duplicate values into the Count column. 

 

QPatterson_1-1625560053307.png

 

This ended up working for me, the flow took about a minute to run, but I ended up with all of the emails listed in a table! Just make sure that you have more rows in the pre-prepared table than emails, otherwise it will run out of space in the table to write all the emails. Make sure as well to set the number of entries loaded into the list to 999 in the get emails step to catch all of them, the default value is 100. Not sure what to do if you have more than 999 emails, maybe try running the flow a few times with a different sorting function each time to grab them in sections?

 

Let me know if you have any questions 🙂

I'm still none the wiser about this. When I run the very simple flow which @efialttes suggested, and I test it, it says Test succeeded. But I have no idea what happened. Has it exported a list?? (I did explain that I am not a techie. I'm still amazed that we have to use Power Automate to extract such very basic data. We're quite new to M365 and don't have any in-house knowledge of Power Automate.)

Hi @LynnS , the extra step to export the list is outlined in my comment above.

Thank you so much! I followed your steps without entirely understanding what I was doing, but it worked perfectly. 

Thanks for the instruction which I tried to follow but it seems I still have an error in my flow? Could you please explain once again when and to where to change the value "1"? Is it in the table or in the flow itself? Appreciate your feedback

Hi @sop2lr 

No worries at all, you'll want to fill out the Update Row step in your flow such that the flow changes the 1 in the current row to something else at the same time that it adds an email address to the current row. All this means is that:

  • Your Key Value field should be equal to 1.
  • Your Count field should contain some unique information, what it is isn't important it's just to make it work. In the example above I used display name but you just as easily put the email addresses in this column too.
  • Your Email field should be set to the email addresses.

The reason for these values is:

Key Value: This is the value the flow is searching in our table for to know what row to update. If we make this value 1, then it will look for the first instance of '1' in our column, starting from the top of the column. It will then do whatever we tell it to do to this row (add an email address) and start again. 

Count: This is the column that needs to contain our 1s that the flow is looking for. When we update a row we need to replace the 1 in this column with something else so that on the next round the flow updates a different row instead of overwriting this same row again. By putting the display name in the Count column, this is telling the flow to change the 1 we initialised our table with to whatever display name we're up to in our loop. This means there won't be a 1 here on the next go through the loop, so a different row will be updated.

Email: This is just where we're storing our email addresses. By putting the Mail attribute in this field, the flow will write an email to the current row on each loop. When the flow is done running, this Email column in our table will have the email addresses we wrote this flow to obtain.

 

Hope this helps 😊

Thank you for this! I was looking for a way to export member email addresses without a script. Two years later, why hasn't Microsoft made this easier for users?

Helpful resources

Announcements

Community will be READ ONLY July 16th, 5p PDT -July 22nd

Dear Community Members,   We'd like to let you know of an upcoming change to the community platform: starting July 16th, the platform will transition to a READ ONLY mode until July 22nd.   During this period, members will not be able to Kudo, Comment, or Reply to any posts.   On July 22nd, please be on the lookout for a message sent to the email address registered on your community profile. This email is crucial as it will contain your unique code and link to register for the new platform encompassing all of the communities.   What to Expect in the New Community: A more unified experience where all products, including Power Apps, Power Automate, Copilot Studio, and Power Pages, will be accessible from one community.Community Blogs that you can syndicate and link to for automatic updates. We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead!

Summer of Solutions | Week 4 Results | Winners will be posted on July 24th

We are excited to announce the Summer of Solutions Challenge!    This challenge is kicking off on Monday, June 17th and will run for (4) weeks.  The challenge is open to all Power Platform (Power Apps, Power Automate, Copilot Studio & Power Pages) community members. We invite you to participate in a quest to provide solutions to as many questions as you can. Answers can be provided in all the communities.    Entry Period: This Challenge will consist of four weekly Entry Periods as follows (each an “Entry Period”)   - 12:00 a.m. PT on June 17, 2024 – 11:59 p.m. PT on June 23, 2024 - 12:00 a.m. PT on June 24, 2024 – 11:59 p.m. PT on June 30, 2024 - 12:00 a.m. PT on July 1, 2024 – 11:59 p.m. PT on July 7, 2024 - 12:00 a.m. PT on July 8, 2024 – 11:59 p.m. PT on July 14, 2024   Entries will be eligible for the Entry Period in which they are received and will not carryover to subsequent weekly entry periods.  You must enter into each weekly Entry Period separately.   How to Enter: We invite you to participate in a quest to provide "Accepted Solutions" to as many questions as you can. Answers can be provided in all the communities. Users must provide a solution which can be an “Accepted Solution” in the Forums in all of the communities and there are no limits to the number of “Accepted Solutions” that a member can provide for entries in this challenge, but each entry must be substantially unique and different.    Winner Selection and Prizes: At the end of each week, we will list the top ten (10) Community users which will consist of: 5 Community Members & 5 Super Users and they will advance to the final drawing. We will post each week in the News & Announcements the top 10 Solution providers.  At the end of the challenge, we will add all of the top 10 weekly names and enter them into a random drawing.  Then we will randomly select ten (10) winners (5 Community Members & 5 Super Users) from among all eligible entrants received across all weekly Entry Periods to receive the prize listed below. If a winner declines, we will draw again at random for the next winner.  A user will only be able to win once overall. If they are drawn multiple times, another user will be drawn at random.  Individuals will be contacted before the announcement with the opportunity to claim or deny the prize.  Once all of the winners have been notified, we will post in the News & Announcements of each community with the list of winners.   Each winner will receive one (1) Pass to the Power Platform Conference in Las Vegas, Sep. 18-20, 2024 ($1800 value). NOTE: Prize is for conference attendance only and any other costs such as airfare, lodging, transportation, and food are the sole responsibility of the winner. Tickets are not transferable to any other party or to next year’s event.   ** PLEASE SEE THE ATTACHED RULES for this CHALLENGE**   Week 1 Results: Congratulations to the Week 1 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Community MembersNumber SolutionsSuper UsersNumber Solutions Deenuji 9 @NathanAlvares24  17 @Anil_g  7 @ManishSolanki  13 @eetuRobo  5 @David_MA  10 @VishnuReddy1997  5 @SpongYe  9JhonatanOB19932 (tie) @Nived_Nambiar  8 @maltie  2 (tie)   @PA-Noob  2 (tie)   @LukeMcG  2 (tie)   @tgut03  2 (tie)       Week 2 Results: Congratulations to the Week 2 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 2: Community MembersSolutionsSuper UsersSolutionsPower Automate  @Deenuji  12@ManishSolanki 19 @Anil_g  10 @NathanAlvares24  17 @VishnuReddy1997  6 @Expiscornovus  10 @Tjan  5 @Nived_Nambiar  10 @eetuRobo  3 @SudeepGhatakNZ 8     Week 3 Results: Congratulations to the Week 3 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 3:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji32ManishSolanki55VishnuReddy199724NathanAlvares2444Anil_g22SudeepGhatakNZ40eetuRobo18Nived_Nambiar28Tjan8David_MA22   Week 4 Results: Congratulations to the Week 4 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 4:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji11FLMike31Sayan11ManishSolanki16VishnuReddy199710creativeopinion14Akshansh-Sharma3SudeepGhatakNZ7claudiovc2CFernandes5 misc2Nived_Nambiar5 Usernametwice232rzaneti5 eetuRobo2   Anil_g2   SharonS2  

Check Out | 2024 Release Wave 2 Plans for Microsoft Dynamics 365 and Microsoft Power Platform

On July 16, 2024, we published the 2024 release wave 2 plans for Microsoft Dynamics 365 and Microsoft Power Platform. These plans are a compilation of the new capabilities planned to be released between October 2024 to March 2025. This release introduces a wealth of new features designed to enhance customer understanding and improve overall user experience, showcasing our dedication to driving digital transformation for our customers and partners.    The upcoming wave is centered around utilizing advanced AI and Microsoft Copilot technologies to enhance user productivity and streamline operations across diverse business applications. These enhancements include intelligent automation, AI-powered insights, and immersive user experiences that are designed to break down barriers between data, insights, and individuals. Watch a summary of the release highlights.    Discover the latest features that empower organizations to operate more efficiently and adaptively. From AI-driven sales insights and customer service enhancements to predictive analytics in supply chain management and autonomous financial processes, the new capabilities enable businesses to proactively address challenges and capitalize on opportunities.    

Updates to Transitions in the Power Platform Communities

We're embarking on a journey to enhance your experience by transitioning to a new community platform. Our team has been diligently working to create a fresh community site, leveraging the very Dynamics 365 and Power Platform tools our community advocates for.  We started this journey with transitioning Copilot Studio forums and blogs in June. The move marks the beginning of a new chapter, and we're eager for you to be a part of it. The rest of the Power Platform product sites will be moving over this summer.   Stay tuned for more updates as we get closer to the launch. We can't wait to welcome you to our new community space, designed with you in mind. Let's connect, learn, and grow together.   Here's to new beginnings and endless possibilities!   If you have any questions, observations or concerns throughout this process please go to https://aka.ms/PPCommSupport.   To stay up to date on the latest details of this migration and other important Community updates subscribe to our News and Announcements forums: Copilot Studio, Power Apps, Power Automate, Power Pages