Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Power Apps Pro Dev & ISV
Answered

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.

  • Verified answer
    Community Power Platform Member Profile Picture
    on at
    Re: Cannot match AADUser to currently logged in user to filter records

    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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Leaderboard > Power Apps - Power Apps Pro Dev & ISV

#1
WarrenBelz Profile Picture

WarrenBelz 89 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 72 Super User 2025 Season 1

#3
mmbr1606 Profile Picture

mmbr1606 71 Super User 2025 Season 1

Overall leaderboard