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 / Cannot match AADUser t...
Power Apps
Unanswered

Cannot match AADUser to currently logged in user to filter records

(0) ShareShare
ReportReport
Posted on by

I have a table with a lookup to AADUser virtual table. Users using one of the applications, should only view records that have been assigned to their AADUser. This is not the same as the record owner in dataverse, so I cannot make use of the normal dataverse security protocols.

 

I've tried populating a collection in the app startup, which is ideal, but even testing it directly in the "text" property of a label, it doesn't work either.

 

My filter I'm using looks like this:

 

ClearCollect(EmpRoles, Filter('Employee Roles','Employee'.'User Principal Name' = Office365Users.MyProfileV2().userPrincipalName));

 

 I checked the "User Principle Name" for my user in AADUser table directly and it's correct there, but this filter doesn't work.

I'm using Office365 connector for now, but also tried the basic User().Email property as well.

I have the same question (0)
  • Verified answer
    Community Power Platform Member Profile Picture
    on at

    I found this to work...

    ClearCollect(EmpRoles, 
     AddColumns('Employee Roles',
     "UserPrinciple", 
     LookUp('AAD Users', 'AAD user id' = 'Employee Roles'[@'Employee'].'AAD user id','User Principal Name'),
     "RoleName",
     LookUp('Roles', Roles = 'Employee Roles'[@'Role'].Roles,Name)));
    
    ClearCollect(EmpRoles, Filter(EmpRoles, UserPrinciple = User().Email));

     

    It did not work when using the 'A unique identifier for AAD User' column, but when using the 'AAD User id' column, it worked, which is silly, because it's the same objects being compared with each other in any case. I suspect this might be because of Canvas app Filter and Lookup functions not returning all of the columns of the child lookup tables, if I have to guess.

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 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard