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 :
Engage with the Community
Suggested Answer

Control UI Visibility in Power Apps Based on AD Security Group Membership

(0) ShareShare
ReportReport
Posted on by

How can we control content visibility in a Power Apps user interface based on whether the logged-in user belongs to a specific Active Directory Security Group?

I want to display tasks dynamically so that:


  • If the logged-in user is part of the designated AD Security Group, they can see tasks assigned to that group.

  • If not, those tasks remain hidden.

  •  

What’s the best approach or recommended pattern to achieve this in Power Apps?

I have the same question (0)
  • Suggested answer
    swaminawale1 Profile Picture
    on at
     
    You can use a 'Office 365 Groups' connector > use formula called 'ListGroupMembers'. Here you have to pass a group id  (guid) as a parameter and you'll get all members of that security group. 
     
    You can create a collection to store the data and using formula like LookUp(<collectionname>, mail = User().Email) you can check if that user is present or not.
     
    I've explained this in my video as well https://youtu.be/YNbRsNDUqzE
  • Suggested answer
    VGKolar Profile Picture
    45 on at

    Power Apps does not natively expose Azure AD security group membership, so content visibility must be handled through a supported pattern. The recommended approach is to filter data at the source, not just hide UI elements.

    The common patterns include:

    • Using Dataverse security roles assigned to Azure AD groups this is most secure and scalable, I can say.

    • Maintaining a user-to-group mapping table in Dataverse or SharePoint and filtering tasks based on the logged-in user.

    • Calling Microsoft Graph via Power Automate to retrieve AD group membership it's advanced and requires premium licensing.

     Once group membership is resolved, tasks can be filtered so only authorized users ever see relevant records in the UI.


    I hope this helps for you.

     
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,719 Super User 2025 Season 2 on at
     
    You mentioned power apps but not what kind of power app.
     
    If you want to do this in a Canvas App, then the pattern it so simply query all the security groups and / roles a person has been assigned. Then inside your app, you would have to do a check against that security group.
     
    What I do is create either
    1) a comma concatenated list of groups for given things as Environment variables. Then query the security groups they are in (there are tons of examples if you search). Then in your expression, in your visible property, do a contains to see if the security group is in the long string
     
    2) use sharepoint or dataverse to store all the security group mappings you have. So you would have a key/value pair which you would then use inside your app.
    You would still need to query their security groups and roles, but now you would do a comparison to see if the key/value pair exists
     
    for instance so you have a button
    In the visible property of the button you would do something like
    CountRows(Filter(MyCollectionOfSecurityRoles/SecurityGroups, Name = SharePoint/DV Name) > 0
     
    This would return true or false and make it visible
     
    FYI this should be in the Power Apps forum not engage.
     
     
    The strategy above allows you to now hardcode but instead use configuration (which you can change) to set the security group or role value that makes it visible or not. 
     

    If these suggestions help resolve your issue, Please consider Marking the answer as such and also maybe a like.

    Thank you!
    Sincerely, Michael Gernaey

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 > Engage with the Community

#1
MS.Ragavendar Profile Picture

MS.Ragavendar 13 Super User 2025 Season 2

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 10 Super User 2025 Season 2

#3
AndyCutler Profile Picture

AndyCutler 5

Last 30 days Overall leaderboard