Hi,
I am looking to get a Security group name for the assigned user in the power app. Example User: Joe Smith Part assign to the Security group name SECADMIN than how to get a particular group name pulled in to power app? I have tried to pull the info using the following command but not successfully.
Filter(Office365Groups.ListGroupMembers().value.mail=User().Email)
-t
Solved! Go to Solution.
Hi @tejal23 :
I have another alternative for your reference,It is Using Graph and Custom Connector.
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
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)
Best Regards,
Bof
Hi @tejal23 :
Do you want to get the group of the current user?
If so,Just use the ListOwnedGroupsV3 action of the Office365Groups connector.I've made a test for your reference:
1\Add a gallery and set it's Items property to:
Office365Groups.ListOwnedGroupsV3().value.displayName
I think this link will help you a lot:
https://docs.microsoft.com/en-us/connectors/office365groups/#actions
Best Regards,
Bof
Hi
Thank you for the update, It does not pull the Security group name. It pulls the MS Team Site group name.
Tejal
Hi @tejal23 ,
My solution is to use AzureAD connector, which fortunately is a standard connector so you can use it without a dedicated PowerApps license .
To achive your goal, you'll interogate AzureAD to get all the groups a user is member of and put the result into a collection (Note that if you put directly to item property of a control you'll receive an error) and also add a column with the name group:
ClearCollect(allGroups,AddColumns(AzureAD.GetMemberGroups(userprincipalname or user id,true),"GroupName", AzureAD.Group(Value).displayName))
This way you can get all security groups (id and group name) a user is member of. If you change the true argument in false you'll receive all the groups a user is member of.
Hope it helps !
Thank you for reply,
I do not want to use the Azure AD connector as we have set up Two-factor Authentication. It will be painfully for a user to authenticate twice to open the App. Any other method to get security group name?
Thanks
-T
???
There is nothing in my solution not working under MFA activated tenant. We have also MFA activated and it's working perfectly. The authorization for AzureAD connector is given only once at the first launch of the app.
Security group are visible only inside AzureAD, so I have big doubts that you find a better solution.
Thank you, I will try it.
-T
Hi @tejal23 :
I have another alternative for your reference,It is Using Graph and Custom Connector.
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
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)
Best Regards,
Bof
Thank you so much for graphs APi connector, I was able to exact the security group name. I have one query, Is it possible to pull the group names for different selected users from dropdown menu? how to send query back to graph api and get the result.
Thank you
Tejal
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
190 | |
57 | |
43 | |
36 | |
34 |
User | Count |
---|---|
270 | |
78 | |
75 | |
74 | |
66 |