cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
robsmaze
New Member

lookup syntax error

I am new to power apps.  I am making a simple app that is connected to two small excel tables.  Most of the info is gathered from the main table (Jobs).  A few items are gathered from the auxiliary table (ParentProject).  Standard setup where the gallery which lists all the items in Jobs goes into a detail view of each job.  In the detail view I pull several pieces of info from the Jobs table including the name which I call "projects".  I need to cross reference the auxiliary table with a lookup function to show a little more data on the detail view.  Here is the problem.

When I create a data label I can get it to pull from the auxiliary table if I manually type in the text in the LookUp function.  for instance:

LookUp(ParentProject, PP = "1000 Museum", RITD)

Where PP is the lookup column and RITD is the return column in the auxiliary table.  But when I want this to happen automatically based on the value in the detail view I can't get it to work.  I have tried replacing the text with:

ThisItem.projects and ThisItem.projects.Text

I also created another datalabel called project_name that displays the correct value for the detail view and tried to reference that.  I have tried:

project_name, project_name.Text, proect_name.Value

None of it seems to work.  Ive spent several hours digging through the docs, but I can't see a clear exampl of where I am going wrong because lookup are rarely shown using two tables in the basic examples.  Any help would be appreciated...

1 ACCEPTED SOLUTION

Accepted Solutions
CNT
Community Champion
Community Champion

@robsmaze Pleased that it's working and glad to help!

 

Please remember to give a 👍 and accept the solution as it will help others in the future.

View solution in original post

7 REPLIES 7
CNT
Community Champion
Community Champion

@robsmaze could you share u'r screen and the items property of the control where u'r trying to do tuff like, ThisItem.projects

robsmaze
New Member

@CNT — Absolutely.  I have included the detail screen, a snap of the main table (Jobs) and a snap of the auxiliary table (ParentProject).  Thanks for looking at this.  I am sure it is a super easy syntax mistake on my part...

CNT
Community Champion
Community Champion

Hi @robsmaze 

Do the values in the projects column of the Jobs table match with the values in the PP Column in the ParentProject table? Just from the look of it they seem to be different. Could you please confirm.

robsmaze
New Member

@CNT they do - that’s why I’m using the lookup function.  The value of projects from the Jobs table have an exact match somewhere in PP in ParentProject table.  I need to get a couple of pieces of data from matching value in the PP column of the Parent Project table.  I know I’m connecting because if I manually enter a text value in the lookup it finds the correct value (that’s what I show in the pics)…. Ive tried a couple of other manual entries and it works.  

@CNT - Oh heck!!  You were right.  I was looking at a job that wasn’t set up in the ParentProject Table.  As soon as I tried a different one it worked just fine with ThisItem.projects.  Totally not paying enough attention!!!  Thanks so much for all your help and pointing out my silly error.  I guess I need to work on an error message that says “NO MATCH FOUND!!!”””

CNT
Community Champion
Community Champion

@robsmaze OK. Where do you have this code,

LookUp(ParentProject, PP = ThisItem.projects, RITD)

In which control and in which property? I'm trying to find what this ThisItem refers to.

CNT
Community Champion
Community Champion

@robsmaze Pleased that it's working and glad to help!

 

Please remember to give a 👍 and accept the solution as it will help others in the future.

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

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.

Top Solution Authors
Top Kudoed Authors
Users online (2,132)