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 / 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,297 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,551 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

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard