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 / Reduce number in Share...
Power Apps
Unanswered

Reduce number in SharePoint list by value in shopping cart

(0) ShareShare
ReportReport
Posted on by 46

Hi All,

 

I have a shopping cart that has a SP list with stock numbers. I have created a formula that identifies the id number attached to the products in the shopping basket and reduces the number by the value in the basket.

 

ForAll(

 colShoppingCart,

 UpdateIf(

 'Merchandise Stock List_1',

 ID in colShoppingCart.ProductID,

 {

 Quantity: Value(

 LookUp(

 'Merchandise Stock List_1',

 ID in colShoppingCart.ProductID

 ).Quantity

 ) - Value(

 LookUp(

 colShoppingCart,

 ProductID in 'Merchandise Stock List_1'.ID

 ). QTY

 )

 }

 )

)

 

The problem is that it deducts the sum of all items in my collection from the stock of each product as well as changing the quantity of each item to the quantity of the first item in the basket. For example, if two items were in a basket with 10 and 15 quantities in stock, after the order the stock count would say 8 for both of them. Is there a way to resolve this?

Categories:
I have the same question (0)

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 335 Most Valuable Professional

#2
11manish Profile Picture

11manish 166

#3
sannavajjala87 Profile Picture

sannavajjala87 71 Super User 2026 Season 1

Last 30 days Overall leaderboard