cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Leapster
Helper I
Helper I

lookup not working

I want to lookup a users role in the company(a column on a sharepoint list called StaffList) on the home screen.  Then use the value to determine what buttons are visible.  However, my lookup is not returning a value.  What am I doing wrong ?

 

LookUp(StaffList, Title = User().FullName).Role

2 ACCEPTED SOLUTIONS

Accepted Solutions

@Leapster
When using a Choices column data is stored in the Value property. Therefore we retrieve the Roles data then drill into the value property.

LookUp(StaffList, Title = User().FullName, Role).Value

—-
Please Accept as Solution if this post answered your question so others may find it more quickly. If you found this post helpful consider giving it a Thumbs Up.

View solution in original post

@Leapster
Here is a link to the complete formulas reference.

Link To Post:
https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/formula-reference

—-
Please Accept as Solution if this post answered your question so others may find it more quickly. If you found this post helpful consider giving it a Thumbs Up.

View solution in original post

8 REPLIES 8
mdevaney
Super User
Super User

@Leapster 

On its own the formula looks fine.  I have no concerns about delegation since you are using a SharePoint list.

LookUp(StaffList, Title = User().FullName).Role

 

There are a few possibilities:

1.  Does User().FullName appear in the Title column?  Test by typing this in the Text property of a label.  True means YES, false means NO.

!IsBlank(LookUp(StaffList, Title = User().Email))

 

2.  Is the Role filled in for User().FullName in your list?  This should be checked if #1 is TRUE.

3.  Did you update your SharePoint list but forget to REFRESH the datasource in PowerApps?  If neither #1 nor #2 this could be the issue.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

eka24
Super User
Super User

LookUp(StaffList, Title = User().FullName,Role)
Anonymous
Not applicable

Try using filter. Filter(Datasource,Filter1). As you are looking for just one record, it should be easy fix.

 

Additionally if the role that you are talking about is similar to job title in Azure ad, then you can use office365users connector instead of having the info stored in SharePoint list.

 

Pls accept it as a solution if this fixes your issue. Don't forget to give a  kudos.

@Anonymous 

FILTER is not recommended here because @Leapster only wants to return a single value.  FILTER will offer lower performance because it  retrieves an entire dataset whereas LOOKUP retrieves only a single value then stops looking.  This makes LOOKUP much more efficient.

 

Also, FILTER returns a table so by itself it won't display any values.  You'd need to do FIRST(FILTER()) but again that will degrade performance.

 

Just trying to be helpful.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

I think part of the issue is the SharePoint column role is filled with a drop down list.  How would this affect the Lookup syntax ?

LookUp(StaffList, Title = User().FullName).Role

 

I ask because I created a regular text column, refresh (thanks for that idea) and the lookup worked, so I can't help but believe the dropdown on the SharePoint is part of the issue.

@Leapster
When using a Choices column data is stored in the Value property. Therefore we retrieve the Roles data then drill into the value property.

LookUp(StaffList, Title = User().FullName, Role).Value

—-
Please Accept as Solution if this post answered your question so others may find it more quickly. If you found this post helpful consider giving it a Thumbs Up.

View solution in original post

That was the trick.  Works perfectly.  Thank you!

 

Can you recommend any reference materials for the syntax on the functions ?

@Leapster
Here is a link to the complete formulas reference.

Link To Post:
https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/formula-reference

—-
Please Accept as Solution if this post answered your question so others may find it more quickly. If you found this post helpful consider giving it a Thumbs Up.

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,374)