Forum Discussion
Ajay_AJ
Jan 27, 2024Copper Contributor
Compare a person type field with the current user
I have a person type field with selecting multiple groups as well as persons and I want to compare it with the current user in powerapps.
I am using the following formula:
Set(varEmail,User().Email);
Filter (Permissions,Title = "Teamleaders" && Lead.Email = varEmail)
Where Permissions --> Sharepoint List Name
Title ---> Text Column
Lead-----> Person Column.
Whereas
1) = gives errors "These types can't be compared : Table,Text"
2) Lead.Email and && gives errors "This part of the formula may not work on large dataset" as delegation
- AFourie74Copper Contributor
The way I got it to work is to use the following:
Filter(Permissions, Title = "Teamleaders" && First(Lead).Email = varEmail)
The reason for this is that a people field is an array even if you set it to not have multiple selections.