cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sanju_bd
Frequent Visitor

Having trouble using search/query between Office365Users and Office365Groups

So, we are looking into some powerapps solution for the workplace but struggling with some search user query. The need is to be able to search Office365Users who belongs to some Azure AD Security groups (Office365Groups). But from what I understand the SearchTerms cant use anything like {groups : 'SecutiryUserGroupID'} and it only can search based on parts of name and username/email .. Essentially I have also tried generating a separate user list (email list) and used that in the search but that is darn slow. Any idea how can this be achieved ?? Thanks In advance

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @sanju_bd :

I am afraid that the function you mentioned is currently not available. If you need this function, I suggest you post your ideal to this forum:

Power Apps Ideas 

In addition,I suggest you try this formula as an alternative:

Ungroup(
    ForAll(
        Office365Groups.ListGroupMembers('GroupID').value As UserList,
        {Users: Office365Users.SearchUserV2({searchTerm: UserList[@mail]}).value}
    ),
    "Users"
)

Best Regards,

Bof

View solution in original post

3 REPLIES 3
v-bofeng-msft
Community Support
Community Support

Hi @sanju_bd :

Could you tell me:

Do you want to search for users in a certain group?

If so,I suggest you use this formula to get all the members in the specified group, and then get the users you are looking for based on the returned result of this formula.

Office365Groups.ListGroupMembers('TheGroupID').value

Best Regards,

Bof

@v-bofeng-msft Thanks for getting back. This is exactly what I had been doing. Generating a separate list based on the groups which seems to have only Email and some other field and not the full office 365 profile that we need. Beside that generating a list (of emails for example) based on the groups takes a while (30 - 40 secs) which is simply not acceptable. 

 

Ideally, I have had been looking for a solution where I can search office365.SearchUser with GroupId can be used as one of the searchTerm. 

Hi @sanju_bd :

I am afraid that the function you mentioned is currently not available. If you need this function, I suggest you post your ideal to this forum:

Power Apps Ideas 

In addition,I suggest you try this formula as an alternative:

Ungroup(
    ForAll(
        Office365Groups.ListGroupMembers('GroupID').value As UserList,
        {Users: Office365Users.SearchUserV2({searchTerm: UserList[@mail]}).value}
    ),
    "Users"
)

Best Regards,

Bof

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!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,435)