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 / Quantity Change Buttons
Power Apps
Unanswered

Quantity Change Buttons

(0) ShareShare
ReportReport
Posted on by 135

I've been working on an inventory app, and I've encountered a small item I need help tweaking.

Bvandyke22_0-1605616521766.png

 

The quantity box Stays blank until you start using the arrows, then it starts at 0 and counts up or down. The save button will only submit what the up or down buttons have input. So if i push up 4 times, the number in the box would be 4, but if I type 9 then hit save, 4 is what would be saved. My code is below.

 

Quantity Text Box= Default : currentQuantityValue

Up Arrow= OnSelect: UpdateContext({currentQuantityValue:currentQuantityValue+1})

Down Arrow= Onselect: UpdateContext({currentQuantityValue:currentQuantityValue-1})

Save Button= OnSelect: 

Patch(PadPartsList, Gallery1_1.Selected, {Quantity:currentQuantityValue});

ResetForm(Form1_1);

Navigate(EPList)

Form Text Box:

Bvandyke22_1-1605616925022.pngBvandyke22_2-1605616958984.png

Bvandyke22_3-1605617059889.png

 

Any Tips would be greatly appreciated. I'm sure It's something about how I have the variable assigned or something. But I'm stumped at the moment.

 

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Bvandyke22 

    Don't reference the variable in your patch, reference the textinput control.

    Patch(PadPartsList, 
     Gallery1_1.Selected, 
     {Quantity: Value(yourQuantityTextboxName.Text)}
    );

     

    I hope this is helpful for you.

  • Bvandyke22 Profile Picture
    135 on at

    When I tried that, the Up and Down buttons no longer work and the patch function does not update the quantity at all.

     

    I did try changing the control on the up and down buttons from UpdateContext({currentQuantityValue:currentQuantityValue-1}) to UpdateContext({TextInput3.Text:currentQuantityValue-1}) and also UpdateContext({currentQuantityValue:TextInput3.Text-1}) with no luck.

  • ganeshsanap Profile Picture
    1,555 on at

    @Bvandyke22 

    Set OnChange property of your text input control to:

     

    UpdateContext({ currentQuantityValue: TextInput3.Text })

     


    Please click Accept as solution if my answer helped you to solve your issue. This will help others to find the correct solution easily. If the answer was useful in other ways, please consider giving it ‌‌👍

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 610

#2
Haque Profile Picture

Haque 317

#3
WarrenBelz Profile Picture

WarrenBelz 315 Most Valuable Professional

Last 30 days Overall leaderboard