I have a people picker field that returns the display name.
I have this code to lookup in another list the employees ID email, department etc. I know I can get most of this from AD but the employeeID is not available.
LookUp(CurrentEmployeeOrg, Lower(Email) = Lower(DataCardValue3.Selected.Email), EmployeeNumber)
This works well in almost every case except when the Users name is Kenneth but the Display is Ken or Judith and display is Judy.
I do not know how to make this work based on this scenario.
Any help would be appreciated.
That's so Random Emails are unique try to Trim emails in the List maybe there is some space in that person email.
LookUp(CurrentEmployeeOrg, Trim(Lower(Email)) = Trim(Lower(DataCardValue3.Selected.Email)), EmployeeNumber)
What do you mean by except when the Users name is Kenneth but the Display is Ken or Judith and display is Judy.
Are you referring to the email in one place being judy.smith@yourDomain.com and the other place judith.smith@yourDomain.com (in which case, it will never work) or simply the DisplayName which has no bearing on this.
Assuming DataCardValue3 Items come from AD (or Office365Users), and the Email field (not a good name) in CurrentEmployeeOrg is the same, then (I agree with @SebS ), your code should work. You can also use StartsWith() as it is not case sensitive.
LookUp( CurrentEmployeeOrg, StartsWith( Email, DataCardValue3.Selected.Email ) ).EmployeeNumber
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
MVP (Business Applications) Visit my blog Practical Power Apps
Keep up to date with current events and community announcements in the Power Apps community.
A great place where you can stay up to date with community calls and interact with the speakers.
Check out the latest Community Blog from the community!