Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Increment number with button

(0) ShareShare
ReportReport
Posted on by 725

Hi all

I have done a search on this but the variants I came across vary slightly on what I want.

I have a text box where I enter a purchase order number e.g 350223. Often I enter consecutive orders. How would I have a button that would add one to the order number that I manually entered?

 

Thank you

  • R Bakker Profile Picture
    725 on at
    Re: Increment number with button

    Thank for that explanation

  • mdevaney Profile Picture
    29,987 Super User 2025 Season 1 on at
    Re: Increment number with button
    @Corissandgeri
    Once you have types a value into the Text Input it no longer shows the Default value. By resetting the control we clear the value you wrote in and replace it with the default value (previous value + 1)

    —-
    Please Accept as Solution if this post answered your question so others may find it more quickly. If you found this post helpful consider giving it a Thumbs Up.
  • R Bakker Profile Picture
    725 on at
    Re: Increment number with button

    Thank you

    This works great, I understand the Set(myPurchaseOrderNum, Value(TextInput1.Text) + 1);

    But don't really understand the resets. 

  • TheRobRush Profile Picture
    11,121 Super User 2025 Season 1 on at
    Re: Increment number with button

    in the onselect of the button

    Set(orderval,value(textinput1.text)); ///textinput1 is name of wherever you type an order number.
    Set(orderval, orderval+1);
    reset(textinput1)

    Then in the default of textinput1 make the value orderval, and in onstart of app add Set(orderval,0) so that starts as 0

  • Verified answer
    mdevaney Profile Picture
    29,987 Super User 2025 Season 1 on at
    Re: Increment number with button

    @Corissandageri 

    Use this code in the OnSelect property of your button

    Set(myPurchaseOrderNum, Value(TextInput1.Text) + 1);
    Set(myPurchaseOrderReset, true);
    Set(myPurchaseOrderReset, false);

     

    Put this code in the Default property of your text input

    myPurchaseOrderNum

     

    And also this code in the Reset property of the text input.

    myPurchaseOrderReset

     

    Now when you click the button it will increment the number you input automatically.

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • eka24 Profile Picture
    20,921 on at
    Re: Increment number with button

    Watch this auto increment by Shane Young
    https://youtu.be/plKw_xfVfwY?t=450

     

     

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard