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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (66,298)