cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dobrien
Regular Visitor

Filter Gallery Items - People - Using 365 Email Distribution List

I am trying to filter a power apps gallery of office 365 users by membership of a distribution list. 

Any suggestions would be really welcome.

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @dobrien ,

Could you please share a bit more about your scenario?

Do you want to filter Office 365 Users based on a specific Distribution List?

 

If you want to filter Office 365 Users based on a specific Distribution List group, please try the following workaround:

8 - Copy.JPG

 

6 - Copy.JPG

 

7 - Copy.JPG

Firstly, please add Office 365 Users connector and Azure AD connector as data source in your app.

Set the OnStart property of App to following:

ClearCollect(
             GroupsCollection, 
             AddColumns(
                         AzureAD.GetMemberGroupsV2(User().Email, false).value, 
                         "GroupName", 
                         AzureAD.GetGroup(Value).displayName
             )
)

 

Add a Dropdown box (Dropdown2), set the Items property to following:

GroupsCollection

specify the "GroupName" as display column value within the Dropdown box.

 

Add a Gallery, set the Items property to following:

Filter(
        Office365Users.SearchUser({top:999}), 
        DisplayName in AzureAD.GetGroupMembers(Dropdown2.Selected.Value).value.displayName
)

If you have already known the Object Id of your Office 365 Distribution List, please consider modify above formula as below:

Filter(
        Office365Users.SearchUser({top:999}), 
        DisplayName in AzureAD.GetGroupMembers("xxxxxxxx-30b3-xxxx-ba1c-xxxx9d8418e9").value.displayName
)

Note: The 'xxxxxxxx-30b3-xxxx-ba1c-xxxx9d8418e9' represents the Object Id of your Distribution List, you need to replace it with your own Distribution List Object Id.

 

Please try above solution, then check if the issue is solved.

 

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

1 REPLY 1
v-xida-msft
Community Support
Community Support

Hi @dobrien ,

Could you please share a bit more about your scenario?

Do you want to filter Office 365 Users based on a specific Distribution List?

 

If you want to filter Office 365 Users based on a specific Distribution List group, please try the following workaround:

8 - Copy.JPG

 

6 - Copy.JPG

 

7 - Copy.JPG

Firstly, please add Office 365 Users connector and Azure AD connector as data source in your app.

Set the OnStart property of App to following:

ClearCollect(
             GroupsCollection, 
             AddColumns(
                         AzureAD.GetMemberGroupsV2(User().Email, false).value, 
                         "GroupName", 
                         AzureAD.GetGroup(Value).displayName
             )
)

 

Add a Dropdown box (Dropdown2), set the Items property to following:

GroupsCollection

specify the "GroupName" as display column value within the Dropdown box.

 

Add a Gallery, set the Items property to following:

Filter(
        Office365Users.SearchUser({top:999}), 
        DisplayName in AzureAD.GetGroupMembers(Dropdown2.Selected.Value).value.displayName
)

If you have already known the Object Id of your Office 365 Distribution List, please consider modify above formula as below:

Filter(
        Office365Users.SearchUser({top:999}), 
        DisplayName in AzureAD.GetGroupMembers("xxxxxxxx-30b3-xxxx-ba1c-xxxx9d8418e9").value.displayName
)

Note: The 'xxxxxxxx-30b3-xxxx-ba1c-xxxx9d8418e9' represents the Object Id of your Distribution List, you need to replace it with your own Distribution List Object Id.

 

Please try above solution, then check if the issue is solved.

 

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,525)