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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Change each items quan...
Power Apps
Unanswered

Change each items quantity based on button click

(0) ShareShare
ReportReport
Posted on by 41

I have gallery that collects all the items the user adds from the previous screen using a "Add to Cart" button. 

In the gallery there's a quantity text input (varQty) and two buttons (+ and -) "See below Image"

For the buttons, I use the following code:

Set(varQty, varQty + 1)

Set(varQty, varQty - 1)

 

When I have more than 1 item in the gallery and click on the buttons, it updates the quantity for all the items.

How to I let the buttons only update the respective item I'm trying to update?

Johnane_0-1668074292618.png

 

Categories:
I have the same question (0)
  • victorcp Profile Picture
    2,350 Moderator on at

    Hi,

    In the gallery where you collect the info, add a new column 'quantity' and everytime the user click on the button update the current item quantity.

    I think this is the best approach

     

    Any question let me know.

    I hope it helps 🙂

  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at

    Is the button outside the gallery?

     

    If yes, I recommend you put your button inside the gallery and, on select property of the button you write:

     

    Patch(

    YourDataSource,

    ThisItem,

    {

    Quantity: varQty

    }

    )

     

    I think it should work. Please, pay attention to the name of the fields and datasource names.

     

    If you need additional help please tag me in your reply and please like my reply.
    If my reply provided you with a solution, pleased mark it as a solution ✔️!

    Best regards,

    Gonçalo Nogueira

    Check my LinkedIn!

    My website!

    My blog!

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard