cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
HaimOz
Advocate IV
Advocate IV

Retrieve current user's AAD Group ID - How?

 Hi all,

I have a Power App Canvas which works with a SQL database.

I'm trying to create a page that presents specific table records, filtered by the user's AAD Group ID (I've got the AAD connector).

Thing is, I'm trying to retrieve the Group ID of the user who is currently logged in (automatically) with no luck (tried to use CheckMemberGroups but I'm probably doing something wrong).

Is there a way to retrieve it and then I can filter my SQL result set based on the retrieved Group ID.

Would appreciate your help.

Thanks,

1 ACCEPTED SOLUTION

Accepted Solutions
Rahber
Solution Sage
Solution Sage

AAD formulas in power apps are behavior formulas.

So set this on visible of the screen.

Set(groupIDs,AzureAD.GetMemberGroupsV2(User().Email,false))

This will get all group IDs of the current logged in user in a variable then you can play around that specific variable to get your required group ID

 

Please click Accept as Solution if it resolved your problem or give it a Thumbs Up if it helped you in anyway this will allow other people to search correct solutions effectively.

Thanks,

Rahber

View solution in original post

2 REPLIES 2
Rahber
Solution Sage
Solution Sage

AAD formulas in power apps are behavior formulas.

So set this on visible of the screen.

Set(groupIDs,AzureAD.GetMemberGroupsV2(User().Email,false))

This will get all group IDs of the current logged in user in a variable then you can play around that specific variable to get your required group ID

 

Please click Accept as Solution if it resolved your problem or give it a Thumbs Up if it helped you in anyway this will allow other people to search correct solutions effectively.

Thanks,

Rahber

Thank you @Rahber,

I'm new to PowerApps and not across all its functionalities but your advise helped a lot.

Appreciate your help!

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (3,686)