Skip to main content

Notifications

Community site session details

Community site session details

Session Id : fBrdeK4UlotGzUwmdpNY6v
Power Apps - Building Power Apps
Answered

Use the Lookup function in powerapps

Like (0) ShareShare
ReportReport
Posted on 18 Jul 2023 06:36:50 by 122

I use this Lookup function to display the quantity in the Sharepoint List CurrentProductsStock if there is an ID equal to the ID of the sharepoint list Product. But I'm still faulty.

Edward00_0-1689661702864.png

Product List:

Edward00_1-1689661839227.png

CurrentProductStock List: 

Edward00_2-1689661897348.png

Column Product in CurrentProductStock List use type Lookup:

Edward00_3-1689662041776.png

Please help me. Thank you very much.

 

 

 

 

Categories:
  • Verified answer
    EddieE Profile Picture
    4,641 Super User 2025 Season 1 on 19 Jul 2023 at 05:26:00
    Re: Use the Lookup function in powerapps

    @Edward00 

    Change

    Gallery9.Selected.ID

    to

    Text(Gallery9.Selected.ID)

  • gvls Profile Picture
    2 on 19 Jul 2023 at 05:03:57
    Re: Use the Lookup function in powerapps

    I assume that its varAddCart  your selected Product.

     

    Lookup(CurrentProductsStock, Product= varAddCart.ID, Quantity)

     

     

    your lookup should be Comparing the columns of Identity Column key and foreign key column.

     Let me know if still face issues.

     

     

     

     


     

  • Edward00 Profile Picture
    122 on 19 Jul 2023 at 04:49:57
    Re: Use the Lookup function in powerapps

    It's faulty like this and it's faulty where the equal sign,sir.

    pw2.png

  • EddieE Profile Picture
    4,641 Super User 2025 Season 1 on 19 Jul 2023 at 04:04:55
    Re: Use the Lookup function in powerapps

    @Edward00 

    I didn't spot that before - but the error is telling you what is wrong, ie Lookup should be LookUp. This is my bad from the code above - sorry.

     

    Try this, then see if you are still getting errors

    LookUp(CurrentProductsStock, Product.Value = varAddCart.ID, Quantity)

     

  • Edward00 Profile Picture
    122 on 19 Jul 2023 at 03:38:38
    Re: Use the Lookup function in powerapps

    I'm guilty like this. So where am I wrong, sir. And varAddCart is what I assign to the gallery item when OnSelect.

    1.

    Edward00_2-1689737852307.png

    2.

    Edward00_0-1689737777702.png

    3.

    pwa_1.png

     

    4.

    Edward00_1-1689737828700.png

     

     

  • EddieE Profile Picture
    4,641 Super User 2025 Season 1 on 18 Jul 2023 at 23:38:10
    Re: Use the Lookup function in powerapps

    @Edward00 

    A few things

     

    1. What is varAddCart? I assumed this is a variable which contains a full record?

    2. Can you hover of the .Value part where the Red line is heavier and capture the error text

    3. Also, do the same as 2 for 'Quantity'

    4. Can you double check the name of the 'Product' column; use

        List settings --> Click the column --> the actual column name is the last part of the URL, eg

     

    EddieE_1-1689723432329.png

     

     

    Also - just for reference - the 'Id' which you where trying to reference in your first formula is simply an internal ID used by the LookUp column and not related to the ID coming from the associated list.

  • Edward00 Profile Picture
    122 on 18 Jul 2023 at 09:46:25
    Re: Use the Lookup function in powerapps

    Edward00_0-1689673562990.png

    it's still faulty.

  • EddieE Profile Picture
    4,641 Super User 2025 Season 1 on 18 Jul 2023 at 06:47:57
    Re: Use the Lookup function in powerapps

    @Edward00 

    Try this

    Lookup(CurrentProductsStock, Product.Value = varAddCart.ID, Quantity)

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,658 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,999 Most Valuable Professional

Leaderboard
Loading started