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

Function LOOKUP

Hi,

I want to find a value in another sharepoint list based on a value in a drop-down list.
I write in the "input text":

LookUp ('Choice - OTP'; OTP = DataCardValue3.Selected.Value; Sites)

but the result is empty. I think the writing is wrong.

Can you help me ?

Thank you,

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Function LOOKUP

Hi @Benoit42 

 

Could you please change the formula expression as:

LookUp ('Choice - OTP',OTP = DataCardValue3.Selected.Value).Sites.Value

 

lookupsite.PNG

 

lookup.gif

 

 

Best Regards.

Yumia 

 

7 REPLIES 7
Super User
Super User

Re: Function LOOKUP

Hi @Benoit42 

For your lookup to work, the lookup list must be in the app as a datasource.   Lookup() function has 3 elements,

  • the datasource being queried,
  • a formula for identifying the first Item in the datasource that matches the formula and
  • the result of that match. 

If no item matches the formula, then it will be blank.   The third  element is optional and if left out, the result will be a single record.  If the third item is specified, then the column value in the selected record will be returned.  For more information about the Lookup() function please see the documentation canvas-apps/functions/function-filter-lookup

Community Support Team
Community Support Team

Re: Function LOOKUP

Hi @Benoit42 

 

Do you want to the input text based on the dropdown selected item?

What columns' types of the columns in your SP list?

You can try the following test. I test with two SP lists.

 

For example:

SP1:'2019Cities' (list name)

       Cities(single line)

       Sites(single line)

SP1.PNG

SP2:'2019test' (list name)

LookUpCities(look up column type, look up from SP1's Cities)

SP2.PNG

 

App Test:

TextInput1.Text=LookUp('2019Cities',Cities=DataCardValue3.Selected.Value).Sites

(the green ones means the controls' names, datasource name and column names on my side, you can change to yours on your side)

On your side:

LookUp ('Choice - OTP', OTP = DataCardValue3.Selected.Value).Sites

lookupfunction.PNG

 

More information:

function-filter-lookup

 

Hope this could be helpful.

 

Best Regards.

Yumia

 

Benoit42
Level: Powered On

Re: Function LOOKUP

Hi @v-yuxima-msft ,

 

1 - Yes I want that the input text based on the dropdown selected item 

2 - I have 2 lists :

    - List Choix-OTP with column OTP (Single line) and Sites (Lookup)

    - List BDD-FNC with column OTP (Lookup based on Choix-OTP) and Site (Single line)

 

I want that the column Site in the list "BDD-FNC" is equal to the column Sites in the list "Choix-OTP" based on the column OTP in the list "BDD-FNC".

 

Thank you

Community Support Team
Community Support Team

Re: Function LOOKUP

Hi @Benoit42 

 

What is the column Sites(look up ) look up from? Is it from the List BDD-FNC's Column Site(Single Line)?

 

Best Regards.

Yumia

Benoit42
Level: Powered On

Re: Function LOOKUP

Hi @v-yuxima-msft;

 

No it's an another list. It's the list (Choix - Site) with a column Site (Single line).

 

Thank you

Community Support Team
Community Support Team

Re: Function LOOKUP

Hi @Benoit42 

 

Could you please change the formula expression as:

LookUp ('Choice - OTP',OTP = DataCardValue3.Selected.Value).Sites.Value

 

lookupsite.PNG

 

lookup.gif

 

 

Best Regards.

Yumia 

 

Benoit42
Level: Powered On

Re: Function LOOKUP

Hi @v-yuxima-msft ,

 

It's good. Thank you very much.

 

Best regards