web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Shopping Cart - Reduce...
Power Apps
Answered

Shopping Cart - Reduce availabe amount when order submitted

(0) ShareShare
ReportReport
Posted on by 15

Hi,

 

I've got two list. One that stores the ordered items with the ordered amount. In the second list I've got all my products.

 

In my ordered items list I've also stored the ID of the products from my productstable once an order is placed.

 

Now I want to do the following: I want to reduce the available amount of the product by the ordered amount of this product which is stored ordered items list.

 

My ordered Items List is looking like this

 

TitleAmountOrder IDProduct ID
Product A214
Product B412
Product XY52 (different Order)6

 

My Product List looks like this:

TitleIDAmount 
Product A4100 
Product B250 
Product XY610 

 

The order can have various products and for all those ordered products I want to reduce the amount in the product list by the value of the ordered amount.

I know that I have to somehow compare the two tables by ID and then update the amount if there is a match. But I don't find the correct formulas.

Thanks in advance for your help.

 

Categories:
I have the same question (0)
  • SebS Profile Picture
    4,863 Super User 2026 Season 1 on at

    Hi @NilsKirsch 

     

    I think this can help to sort out the challenge You experience:

     

    https://www.matthewdevaney.com/build-a-shopping-cart-in-power-apps/

     

    Hope it helps

  • Verified answer
    SebS Profile Picture
    4,863 Super User 2026 Season 1 on at

    Hi @NilsKirsch 

     

    Here is a patch function for You, keep in mind Amount column in both Lists needs to be set to number

     

     

     

     

    ForAll(
     OrderItems As Order,
     Patch(
     ItemList,
     LookUp(
     ItemList,
     ID = Order.ProductID
     ),
     {
     Amount: LookUp(
     ItemList,
     ID = Order.ProductID,
     Amount
     ) - Order.Amount
     }
     )
    )

     

     

    Also You will need to handle if product will go to zero

     

     

    Hope this helps

     

  • NilsKirsch Profile Picture
    15 on at

    Woow excellent @SebS. Works as expected. Thank you a lot. That drove me nuts 😖

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 325 Most Valuable Professional

#2
11manish Profile Picture

11manish 165

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 88 Super User 2026 Season 1

Last 30 days Overall leaderboard