cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Slowpoke
Resolver II
Resolver II

Problem With LookUp on SP List

Hi everyone,

I have a SP List called 'Cat Man' with 3 columns: "Titre","Pilote","Mail".

I'm trying to create a Patch Fonction using a Lookup Fonction that get the value from a combobox selected item. But I have issues with it. The function that I use: 

LookUp('Cat Man'; ComboBox4.Selected.'Nom du groupe mis a jour'='Cat Man'.Title; 'Cat Man'.Mail)

 

But it doesn't show anything.

And this function:

LookUp('Cat Man'.Mail; ComboBox4.Selected.'Nom du groupe mis a jour'='Cat Man'.Title)


I get an error saying that I can't compare a Text and Table.

Does anyone as an idea to make it work.

Thanks by advance.

1 ACCEPTED SOLUTION

Accepted Solutions

Ok I managed to make it work:

LookUp('Cat Man'; Title=ComboBox4.Selected.'Nom du groupe mis a jour').Mail

View solution in original post

8 REPLIES 8
RandyHayes
Super User
Super User

@Slowpoke 

Yes, you are asking the Lookup to compare a table to a text string - 'Cat Man'.Title is a table!

This will not be valid. 

 

Please consider changing your Formula to the following:

LookUp('Cat Man'.Mail; 
    Title = ComboBox4.Selected.'Nom du groupe mis a jour'
)

 

This will return the first record that matches the criteria.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Ok, I tried this, but then I get the error: you can't compare those types: Control and Text.

I tried other things but none of them seems, to work. I'm starting to think that what I'm trying to do is not possible.

RandyHayes
Super User
Super User

@Slowpoke 

What is the exact formula you have now that has the error?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

The same one as you wrote above

So this one:

LookUp('Cat Man'.Mail; Title=ComboBox4.Selected.'Nom du groupe mis a jour')

@RandyHayes 

And also, when I create a Label with this formula:

 

Label3.Text = Text(Combobox4.Selected.'Nom du groupe mis a jour')

 

 

And I try to use this label in the Lookup, so with this formula:

 

LookUp('Cat Man'.Mail; Title=Label3)

 


I get the error: you can't compare control and control, but only with this symbol (and not the red cross):

Slowpoke_0-1663777606222.png

 



RandyHayes
Super User
Super User

@Slowpoke 

The last formula with the error is correct (that you have an error) Label3 is a control...not a value!  You can't compare that.

 

What is the Items property of your Combobox4 control?

And what kind of column is 'Nom du groupe mis a jour' in your list?

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

The items property of my combobox is:

 

PNL.'Nom du groupe mis a jour'



And 'Nom du groupe mis a jour' comes from another list called PNL, and it's a single string column with categories that look like this : "AA0000 - CATEGORIE NAME".

Ok I managed to make it work:

LookUp('Cat Man'; Title=ComboBox4.Selected.'Nom du groupe mis a jour').Mail

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

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