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
User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

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