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 / 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,989 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,989 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

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard