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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Search user in Securit...
Power Apps
Unanswered

Search user in Security Group

(0) ShareShare
ReportReport
Posted on by 2
Hi Everyone,
 
I have a azure security group and it contains 4000+ users. If currently logged in user is part of this group then I have to grant access (enable/disable a section to approve) a section.
 
When I user Office365Groups connector it's not helping due to 4000+ users
 
/* this code will return a list of 100 users and user is after 100 I can't validate in the collection*/
ClearCollect(
    DLIST_Collection,
    Office365Groups.ListGroupMembers(DLIST_TGS_Everyone).value
);
 
/* This also doesn't search user in group, looks like it get first 100 users in and search in the 100 users only*/
ClearCollect(
    DLIST_Collection,
    Filter( Office365Groups.ListGroupMembers(DLIST_TGS_Everyone).value ,mail   = "<User Email>")
);
/* Count is 100*/
Set(
    DLIST_Collection_Counts,
    CountRows( Office365Groups.ListGroupMembers(DLIST_TGS_Everyone).value)
);
 
Can someone suggest best way to search a user in large security group.
 
Thanks,
Chirantan
I have the same question (0)
  • WarrenBelz Profile Picture
    153,127 Most Valuable Professional on at
    Try this (with your Group Id) - it will return true or false.
    User().EntraObjectId in Office365Groups.ListGroupMembers("YourGroupIdHere").value.id
     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    LinkedIn   
  • CU-06021352-0 Profile Picture
    2 on at
    Thank you for your response but it's not working it 
     
    I tried 
    ClearCollect(
        DLIST_TGS_Everyone_Col_Test,
        "User's Object ID" in  Office365Groups.ListGroupMembers(DLIST_TGS_Everyone).value.id
    );
     
    If this User's Object ID is in first 100 users then it returns true but if users id is NOT in first 100 it will return false.
     
    It looks like Office365Groups.ListGroupMembers(DLIST_TGS_Everyone).value.id brings a list for 100 users and then it search in first 100 and return true or false. 
     
    I tried one more option - to top works up to maximum 500 and return a copy of 500. More than that number it returns empty collection.
    ClearCollect(
        DLIST_TGS_Everyone_Col_Test,
        "User's Object ID" in  Office365Groups.ListGroupMembers(DLIST_TGS_Everyone,{'$top':(4000)}).value.id
    );
     
    Thanks,
    Chirantan
  • Michael E. Gernaey Profile Picture
    53,493 Super User 2025 Season 2 on at
    Hi,
     
    You have to go to Settings, and Change it from 500 to 2000 (max delegatable).
     
    You cannot pull back 4000, you can only bring back a max of 2000 into a collection, hence why delegation is only maxxed out to 2000, default is 500 hence the 500.
     
    My guess is you are getting a Delegation Warning. That's why it has to be in the first 100, or 500 or 2000.
     
    You need a delegatable filter so that it will traverse the full list (which can still be limited on how many it will traverse even on the server side)
  • WarrenBelz Profile Picture
    153,127 Most Valuable Professional on at
    From a bit of research, it appears that 999 is the most you are going to get with that connector, either in Power Apps or Power Automate. You might have a read of this article which would require Power Automate using Graph API, but I have never needed to head down that track.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard