Skip to main content

Notifications

Power Automate - Building Flows
Answered

Department of office group members

Posted on by 4
Hello, is there some way to to retrieve all group members that have a certain department?
 
I know that you can list group members with the list group members (Office 365 groups) action and then select wanted values with the select (Data Operation) action, but as far as I know it's not possible to select the department of the group members as a chosen value.
In turn it is possible to get the department of a chosen user with the Office 365 User connector.
Is there some way to combine these two to get the best of both worlds?
  • LH-20111556-0 Profile Picture
    LH-20111556-0 4 on at
    Department of office group members
    Thank you! That solved my problem.
  • Verified answer
    Nived_Nambiar Profile Picture
    Nived_Nambiar 16,554 on at
    Department of office group members
    Hi,
     
    You have to use get user profile action to get department details of each user by iterating through results of o365 group connector - get group members, see below
     
    1. Get the group members using get group members action and then initialize an empty array variable to store the details of user who are in specific department
     
     
    2. Iterate through each group member details using apply to each loop as shown below
     
    Below steps will be under apply to each loop as shown below
    2.1 - use get user profile action by providing the user id from get group members action output as shown below
     
    2.2- use condition to check whether the department is value is specifc which you are looking for and if found, append the user details to array as shown below
     
     
     
     
     
    Hope it helps !
     
    Mark it as solution if it resolves your query !
     
    Thanks & Regards,
    Nived N
     

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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,246

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,884

Leaderboard