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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Department of office g...
Power Automate
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?
Categories:
I have the same question (0)
  • Suggested answer
    Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at
    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
    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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 875

#2
Valantis Profile Picture

Valantis 817

#3
Haque Profile Picture

Haque 481

Last 30 days Overall leaderboard