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 :
Power Automate - Building Flows
Suggested answer

Department of office group members

(0) ShareShare
ReportReport
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?
I have the same question (0)
  • Suggested answer
    Nived_Nambiar Profile Picture
    18,029 Super User 2025 Season 2 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
     
  • LH-20111556-0 Profile Picture
    4 on at
    Department of office group members
    Thank you! That solved my problem.

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 560 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 347 Moderator

#3
Expiscornovus Profile Picture

Expiscornovus 262 Most Valuable Professional

Last 30 days Overall leaderboard