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 / Office365Groups Connec...
Power Apps
Answered

Office365Groups Connector to security group

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello,

 

I'm using Office365 groups connector to validate the memebership of the loggued user.

But now i have a group created as security group and the list displayed (the blue one on image).

How can I get Security groups of AD with this connector?

Should I use another connection?

I reviewed the documentation about the method and can't see anything wrong.

CarlosAcuna_And_0-1600203592654.png

 

Thanks for your help. Regards

 

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    Take a look at the AzureAD connector.  That should be able to validate against Security groups.

    The Office365 connector only deals with the 365 Groups.

     

    I hope this is helpful for you.

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

    Hi @Anonymous :

    Could you tell me if you want to get the list of security groups of the current user?

    I strongly agree with @RandyHayes .The point is "Office365 groups connector can not get the list of Security groups".

    My suggestion is to use Graph and Custom connector to get the security group.I'v made a test for your reference:

    Firstly,Using List memberOf

    Get https://graph.microsoft.com/v1.0/me/memberOf

    Can get all groups the current user belong to(inclould securtiy groups),You can use this URL to test the graph you are going to use.

    Seconldy,If you want to use this command, you must call it through a custom connector

    Please refer to this link

    1.jpg2.JPG

    Finally,Get the security group of the current user by filtering the records whose 'securityEnabled' value is true.

    For Example:

    Add a gallery and set it's Items property to:

    Filter(ListAllGroupsInMyOrg.MyGroups().value,securityEnabled)
    • ListAllGroupsInMyOrg is my custom connector
    • MyGroups is my custom Action

    3.JPG

    Best Regards,

    Bof

     

  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    Although you can consider the Custom Connector as mentioned by @v-bofeng-msft , this will incur licensing considerations as the custom connectors are consider a premium connection.

    However, the steps taken can be done completely with the AzureAD connector now.

     

    If you want to get a list of all the security groups that the current user is a member of, then you can utilize this formula:

    ClearCollect(colADGroups, AddColumns(AzureAD.GetMemberGroupsV2(User().Email, true).value, "theGroup", AzureAD.GetGroup(Value)))

    Note: this particular function is a behavioral function and must be done in a behavioral action.  In this case I am collection the list of groups.  Also, I am adding a column to the collection that will have the actual Group details in it - which is gathered by GetGroup.

    At this point, your Gallery (if you were to use one) would have an Items property of colADGroups and you could display the information in a few labels - example ThisItem.theGroup.displayName, etc.

     

    If your intention is to just check membership in the group, then you can utilize a formula such as this:

    ClearCollect(colADGroups, AddColumns(AzureAD.GetMemberGroupsV2(User().Email, true).value, "groupName", AzureAD.GetGroup(Value).displayName))

    (remember: you need to do this in a behavioral action)

    Then you can check against that collection for the name of the group you are interested in.

     

    Or, perhaps a more elegant solution (since you just want to know membership in that particular security group) - Set a variable:

    Set(IamInTheGroup,
     CountRows(
     Filter(
     AddColumns(AzureAD.GetMemberGroupsV2(User().Email, true).value, 
     "groupName", AzureAD.GetGroup(Value).displayName),
     groupName = "yourSecurityGroupName"
     )
     ) > 0
    )

     

    If the user is in the security group, the IamInTheGroup variable will be true.

     

    No additional licenses needed.

  • Suggested answer
    MT-09122050-0 Profile Picture
    8 on at
    I recently ran into this problem as well and was able to solve it with this function:
    ClearCollect(SecurityGroups,Office365Groups.ListGroups({'$filter': "securityEnabled eq true"}).value);
     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 914

#2
11manish Profile Picture

11manish 617

#3
Valantis Profile Picture

Valantis 598

Last 30 days Overall leaderboard