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 / Increment number with ...
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

Categories:
I have the same question (0)
  • eka24 Profile Picture
    20,923 on at

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

     

     

  • Verified answer
    mdevaney Profile Picture
    29,991 Moderator on at

    @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."

  • TheRobRush Profile Picture
    11,128 Moderator on at

    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

  • R Bakker Profile Picture
    725 on at

    Thank you

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

    But don't really understand the resets. 

  • mdevaney Profile Picture
    29,991 Moderator on at
    @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

    Thank for that explanation

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!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 531 Most Valuable Professional

#2
Haque Profile Picture

Haque 261

#3
Kalathiya Profile Picture

Kalathiya 221 Super User 2026 Season 1

Last 30 days Overall leaderboard