web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : QwWh5zAtB57fBSKkKZrFUI
Power Automate - Building Flows
Answered

Office 365 Groups - List group members

Like (0) ShareShare
ReportReport
Posted on 3 May 2024 00:44:44 by

Hello guys, I am trying to get all the group members of my 25 Office 365 Groups and insert it as rows in SQL. Is there an easy way to get all in one object or is it one by one - 25 pcs of the image below?

nagestiada_1-1714697077194.png

 

I have the same question (0)
  • v-yetonggu-msft Profile Picture
    on 03 May 2024 at 01:02:27
    Re: Office 365 Groups - List group members

    Hi @nagestiada ,

    I recommend that you put all member ’ID‘into an array, and then use ‘Apply to each’ to loop through all ’ID‘ to find the member's information.

    I did a test for your reference.

    In my scenario:

    vyetonggumsft_2-1714698487041.png

     

    [
     {
     "ID": "100001"
     },
     {
     "ID": "100002"
     },
     {
     "ID": "100003"
     },
     {
     "ID": "100004"
     },
     {
     "ID": "100005"
     },
     {
     "ID": "100006"
     }
    ]
    
    items('Apply_to_each')?['ID']

     

    Best Regards,

    Sunshine Gu

  • nagestiada Profile Picture
    504 on 03 May 2024 at 09:37:20
    Re: Office 365 Groups - List group members

    I tried to add another column after ID so I can get the actual GID name before I insert into SQL but I am getting an error.

     

    [
     {
     "ID": "100001",
     "GIDName": "Admin"
    
    
     },
     {
     "ID": "100002",
     "GIDName": "User"
     },
     {
     "ID": "100003",
     "GIDName": "Super Admin"
     },
     {
     "ID": "100004",
     "GIDName": "Bot"
     },
     {
     "ID": "100005",
     "GIDName": "Dummy User"
     },
     {
     "ID": "100006",
     "GIDName": "Test User"
     }
    ]

     

     

    The variable 'GroupID' of type 'Array' cannot be initialized or updated with value of type 'String'. The variable 'GroupID' only supports values of types 'Array'.

     

  • Verified answer
    v-yetonggu-msft Profile Picture
    on 03 May 2024 at 09:41:35
    Re: Office 365 Groups - List group members

    Hi @nagestiada ,

    Please check whether the type of your initialized variable is Array type:

    vyetonggumsft_1-1714729276317.png

    Best Regards,

    Sunshine Gu

     

     

  • nagestiada Profile Picture
    504 on 03 May 2024 at 11:06:52
    Re: Office 365 Groups - List group members

    @v-yetonggu-msft , Yes it is Array

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 788 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 452 Moderator

#3
developerAJ Profile Picture

developerAJ 302

Last 30 days Overall leaderboard