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 is the problem with using names. On the other hand, emails are unique and would be a better choice for a lookup.
I am using emails and it is still not working as expected.
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)
@Dorinda ,
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
User | Count |
---|---|
261 | |
130 | |
99 | |
48 | |
47 |