cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
J0hn
Level: Powered On

Look up function returning False

Hello Everyone,

 

I have create a screen that i want to pull data from a cell in excel based on the users name. I am using "Lookup" but the result keeps returning false. Is "Lookup" my best option or should i be using something different? Thanks.Capture.JPG

10 REPLIES 10
Administrator
Administrator

Re: Look up function returning False

Let me tag some SharePoint experts here who can ask the right questions and get you where you need to be.

 

Can you start by telling us about what type of columns each of those fields are?

 

CC @gsivasai @ManuelaPichler 

J0hn
Level: Powered On

Re: Look up function returning False

Thanks Mr. Dang, Essentially what I want is to show the employees there yearly vacation and there total requested days off. I want to do this by having a lookup that if the employee signed in matches the employees name the field returns the value in the cell. Employee Name -Text, the other columns are General. Thanks for your assistance with this issue.

Capture.JPG 

Highlighted
PowerApps Staff CarlosFigueira
PowerApps Staff

Re: Look up function returning False

You will get the 'false' result out of a LookUp function if it is not able to find any record in your table that matches the condition that you passed to it. Based on your screenshot, it seems like the table in your Excel file is empty - typically the table rows in Excel will have alternating colors and you can use the headings to filter - take a look at the image below for one sample table that I created:

ForumPost001.PNG

In your table, it seems to be empty (only the first row is highlighted), and the information, while present in the spreadsheet, seems to be outside of the table boundaries. One way to find out if you are in a table in Excel - select one of the cells; if the 'Table Design' option appears in the ribbon, then you are in the table; otherwise you are outside of the table.

A note about the 'false' result - currently there are many functions that treat blank (null) values as false. If you enable the 'Formula-level error management' option in the app settings (see below), then the value that you will receive from the LookUp function will indeed be blank, not false.

ForumPost002.PNG

Hope this helps!

J0hn
Level: Powered On

Re: Look up function returning False

Hello Carlos,

 

Thank you very much for your assistance. You are correct that the table was not setup properly I have since made the changes you recomended but am now returning a blank result. Do you have any further suggestions?

Capture.JPGCapture.JPG

PowerApps Staff CarlosFigueira
PowerApps Staff

Re: Look up function returning False

Can you confirm that the name that you have blanked out in the table is the same value as User().FullName? If you add a new screen in your app and three labels with the following values for the Text property, you should be able to confirm this:

Label1.Text: First(Table7).'Employees Name'
Label2.Text: User().FullName
Label3.Text: If(First(Table7).'Employees Name' = User().FullName, "The same", "different")
J0hn
Level: Powered On

Re: Look up function returning False

Carlos,

 

I am getting a return of different but the names are correct in both areas. Please see below screen shot's.Capture.JPGCapture.JPG

PowerApps Staff CarlosFigueira
PowerApps Staff

Re: Look up function returning False

Another thing you can try to do is to add a gallery to show what values you have from your table. That will help to identify if the data is indeed coming from the table. The screen capture below shows how you can do that.

AddGalleryToShowTable.gif

One thing to notice is that if you updated the Excel table so that it will contain all the data that you need, you will need to add the table again to your app (go to View -> Data Sources, remove the previous table, then add it again).

J0hn
Level: Powered On

Re: Look up function returning False

Hello Carlos,

 

I added a gallery but it looks like its returning sharepoint names. I do have the spreadsheet created in OneDrive and am using Excel online would this make a difference?

Capture.JPG

PowerApps Staff CarlosFigueira
PowerApps Staff

Re: Look up function returning False

Please check that the data source used in the gallery is the table from your OneDrive account, and not the SharePoint list. You can check the names / sources of the data sources in the View -> Data Sources menu.