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 Platform Community / Forums / Power Automate / Department of office g...
Power Automate
Unanswered

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?
Categories:
I have the same question (0)
  • Suggested answer
    Nived_Nambiar Profile Picture
    18,129 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 497 Moderator

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 477 Super User 2025 Season 2

#3
chiaraalina Profile Picture

chiaraalina 242

Last 30 days Overall leaderboard