web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Having trouble using s...
Power Apps
Answered

Having trouble using search/query between Office365Users and Office365Groups

(0) ShareShare
ReportReport
Posted on by 6

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

Categories:
  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    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

  • sanju_bd Profile Picture
    6 on at

    @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. 

  • Verified answer
    v-bofeng-msft Profile Picture
    Microsoft Employee on at

    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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 405 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 368

#3
WarrenBelz Profile Picture

WarrenBelz 244 Most Valuable Professional

Last 30 days Overall leaderboard