cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Kumar9024021
Helper V
Helper V

Filter Office365Groups by department

Hi,

 

Due to the delegation limitations, I am unable to use Office365.SearchUser() function fully. However, alternatively I have Office365 Groups where we have separate groups maintained for each JobTitle by which i can avoid delegation. Planned to use that. However, I noticed I am unable to filter by department.

 

Is there anyway once I have returned all Office365Groups members, can i filter by specific department ??

 

Office365Groups.ListGroupMembers("XXXXXXXXXXXXXXXXXXXXXXX").value.displayName

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @Kumar9024021 ,

Do you want to filter your member results returned from the Office365Groups.ListGroupMembers(...) function based on a specific department?

 

If you want to filter your member results returned from the Office365Groups.ListGroupMembers(...) function based on a specific department, I afraid that there is no direct way to achieve your needs.

The result the Office365Groups.ListGroupMembers(...) function returned does not contain "department" property. As an alternative solution, I think the combination of Office 365 Users connector and Office 365 Groups connector could achieve your needs.

 

I have made a test on my side, please consider take a try with the following formula:

Filter(
       AddColumns(
                   Office365Groups.ListGroupMembers("xxxxxxxxxxxxxxxxxx").value, 
                   "department", 
                   Office365Users.UserProfile(id).Department
       ),
       department = "Specific Department"
)

 

More details about the AddColumns function, please check the following article:

AddColumns function

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Krishna92
Microsoft
Microsoft

@Kumar9024021 

 

I think office 365 groups List group members action will not give the department details.

It will only fetch information about user name, display name. jobtitle, mail and office location.

 

you can setup a filter with this information.

You can check the below documentation for more information regarding filter query in power apps.

The query you have posted below it will fetch only display name, you can change display name with any other desired filed and can setup formula accordingly.

 

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-filter-lookup

 

If this information helps you, please hit the like button and mark the solution as resolved, so that it will help other users in future.

v-xida-msft
Community Support
Community Support

Hi @Kumar9024021 ,

Do you want to filter your member results returned from the Office365Groups.ListGroupMembers(...) function based on a specific department?

 

If you want to filter your member results returned from the Office365Groups.ListGroupMembers(...) function based on a specific department, I afraid that there is no direct way to achieve your needs.

The result the Office365Groups.ListGroupMembers(...) function returned does not contain "department" property. As an alternative solution, I think the combination of Office 365 Users connector and Office 365 Groups connector could achieve your needs.

 

I have made a test on my side, please consider take a try with the following formula:

Filter(
       AddColumns(
                   Office365Groups.ListGroupMembers("xxxxxxxxxxxxxxxxxx").value, 
                   "department", 
                   Office365Users.UserProfile(id).Department
       ),
       department = "Specific Department"
)

 

More details about the AddColumns function, please check the following article:

AddColumns function

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,556)