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

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PWREduCon768x460.png

Join us at PWR EduCon - A Power Platform Conference

Learn from the top Power BI, Power Apps, Power Automate & Power Virtual Agents experts!

Top Solution Authors
Top Kudoed Authors
Users online (2,709)