cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
godala_vamshi
Helper III
Helper III

SQL LookUp issue on Canvas App

Hello, 

 

I have IT Support sql table(Table A) which has ApplicationMatrixId column, On a label in App I am trying to lookup Application Name from ApplicationMatrix sql table(Table B) based on ApplicationMatrixId on Table A, but for some reason syntax is not recognizing ApplicationMatrixId. Am I doing something wrong?

 

"App Name: " & LookUp(ApplicationMatrix, Id = ApplicationMatrixId , ApplicationName)

 

Thank you!

godala_vamshi_1-1633563593400.png

 

godala_vamshi_0-1633563493901.png

 

1 ACCEPTED SOLUTION

Accepted Solutions

@godala_vamshi One of this should work:

 

LookUp(ApplicationMatrix, Id = Value(DataCardValue1.Text), ApplicationName)

or

LookUp(ApplicationMatrix, Id = DataCardValue1.Text, ApplicationName)

or

LookUp(ApplicationMatrix, Id = DataCardValue1.Value, ApplicationName)

 

Also I see that what you basicly using is Left Join from SQL, if you want to explore topic further its possible to recreate LEFT JOIN capabilities in Power Apps Directly,  here Ive created video about this topic:

A) LEFT JOIN:

https://youtu.be/tABaxLVAnvs

B) INNER JOIN:

https://youtu.be/tABaxLVAnvs

 

This is only optional, but may be helpful depending on your needs regarding Joining those collections

 

Hope that helps,

 

Zbigniew

 

View solution in original post

16 REPLIES 16
BCLS776
Super User
Super User

It looks like you are working off of a form, possibly connected to a gallery, right?

 

If so, ApplicationMatrixId is probably a column name, not a reference to the specific field in a record. Instead try:

"App Name: " & LookUp(ApplicationMatrix, Id = ThisItem.ApplicationMatrixId , ApplicationName)

Hope that helps,

Bryan

 

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.

@BCLS776  Yes, that ApplicationMatrixId column is in IT Support sql table, I need to get ApplicationName from ApplicationMatrix table, still error when I use ThisItem. 

Thank you! 

 

godala_vamshi_0-1633583530147.png

 

BCLS776
Super User
Super User

Could you share the whole error message? It is not clear what Power Apps is having an issue with

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.

@BCLS776 For = below is the error. 

godala_vamshi_0-1633628688909.png

For ThisItem, below is the error 

godala_vamshi_1-1633628790678.png

 

 

BCLS776
Super User
Super User

Hmm, it is struggling with the reference to that column. Can you share the code that populates the label in the ApplicationMatrixID card in your form, the one that shows the value of 519 in your screenshot? We should be copying that same reference. Also, can you double-check that the IT Support table has a column named "Id"?

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.

Hello, 

Letter Sizes matters, in Function you have different name than in form, one have lower letters in id, other have Id,

Possible that is the problem, check it:

Z_Lukowski_0-1633637953611.png

 

BR

Zbigniew

@BCLS776 For ApplicationMatrixID it is Parent.Default, I tried copying with it reference. 

 

godala_vamshi_0-1633638340719.png

godala_vamshi_2-1633638685127.png

 

IT Support will have Id but we need to use ApplicationMatrixid to get the name 

godala_vamshi_1-1633638480543.png

 

 

@Z_Lukowski Its the same, I also tried as you said but same issue. 

godala_vamshi_3-1633638789338.png

 

Sry, Im little blind I guess,

Can you check what will prompt after you write "ThisItem." (Inntelij should give you some options), try creating inside your context label with ThisItem.ApplicationMatrixID and check what it contains?

 

Also can we have two checks:

1) Show the navigation left panel to check if we are still in context of Gallery/form with the label

2) Check ApplicationMatrix SQL table to make sure that "ID" is there? Can you refresh your DataSource as well just to be 100% sure?

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!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,824)