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.
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.
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:
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.
Hope this helps!
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?
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")
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.
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).
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?
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.
Continue your learning in our online communities.
Stay Up-to-Date by following PowerApps on Twitter
Let's thank our top community contributors
Features releasing from October 2019 through March 2020
Coming to a city near you
Fill out a quick form to claim your user group badge now!
Connect, share, and learn with your peers year-round
Features releasing from April 2019 through September 2019!