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 / Patch multiple records...
Power Apps
Answered

Patch multiple records in a collection

(0) ShareShare
ReportReport
Posted on by 33

I have a shopping app that allows users to purchase items. I am currently having an issue trying to patch/update my gallery collection. The issue occurs when a user tries to increase the quantity in the checkout screen, the price should adjust in the collection. However, when I increase the quantity, instead of the price going 200, 400, 600, 800 etc. it goes 200, 200, 400, 800, 1600 etc. Almost like it is doubling.

 

The code I am using is:

Patch(ColProductOrder,ThisItem,{Price:ThisItem.Price * Value(ThisItem.Qty),Qty:ThisItem.Qty + 1,Name:ThisItem.Name,Brand:ThisItem.Brand,Colour:ThisItem.Colour,Size:ThisItem.Size,Image:ThisItem.Image})

 I have also tried using Update instead of Patch and this has the same outcome.

 

Any help would be much appreciated.

Categories:
I have the same question (0)
  • Verified answer
    v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @Seanan ,

     

    Before using patch , please save the Qty value in a variable firstly and use it in patch Price field.

    Set(var,Value(ThisItem.Qty));Patch(ColProductOrder,ThisItem,{Price:ThisItem.Price * var,Qty:ThisItem.Qty + 1,Name:ThisItem.Name,Brand:ThisItem.Brand,Colour:ThisItem.Colour,Size:ThisItem.Size,Image:ThisItem.Image})

     

    Best Regards,

    Wearsky

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

#2
11manish Profile Picture

11manish 192

#3
Valantis Profile Picture

Valantis 128

Last 30 days Overall leaderboard