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 / Add Leading Zero's on ...
Power Apps
Unanswered

Add Leading Zero's on Number Input

(0) ShareShare
ReportReport
Posted on by 18

Hi, 

 

I'm having trouble adding leading zeros to one of my number fields in powerapps forms.

 

All order numbers in 'Number' Field need to be formatted as '000', so 1 would appear as "001".

 

I don't want this to be formated AFTER the submition of the edit form as I'm using this number to concatenate multiple fields in another field called 'Ref'

 

Here is a picture...

 

Screenshot (20).png

Categories:
I have the same question (0)
  • v-monli-msft Profile Picture
    on at

    Hi @KatieF,

     

    What did you mean by "I don't want this to be formated AFTER the submition of the edit form as I'm using this number to concatenate multiple fields in another field called 'Ref'"? How did you bind the inputs in the Number column to Ref before the submition?

     

    Still, I do not understand what is your requirement. Did you mean that you want to just type 1 in Number, and when submitted, it shows as 001? Or you want to force the user that they can only type 00X at the beginning? If so, this cannot be achieve while typing in TextInput control, maybe you could use Dropdown control to achieve this?

     

    Regards,

    Mona

  • KatieF Profile Picture
    18 on at

    I'm sorry my knowledge of powerapps are a bit limited... I don't need it for the concatenate anymore as it limits some other functions. Yes exactly, if someone types 1, I would like it to appear as a 3 digit number 001

  • KatieF Profile Picture
    18 on at

    I'm sorry my knowledge of powerapps are a bit limited... I don't need it for the concatenate anymore as it limits some other functions. Yes exactly, if someone types 1, I would like it to appear as a 3 digit number 001

  • Verified answer
    v-monli-msft Profile Picture
    on at

    Hi @KatieF,

     

    If you mean that you just want to add two zeros before the input, you could try:

     

    Add another textinput control named "TextInput2", and you set the Default property of the original textinput1 control that included when you create the edit form to formula like this:

    Concatenate("00",TextInput2.Text)

     

    Then when you type 1 in TextInput2 control, it will show as 001 in TextInput1 control which will be submitted when you submit the form.

     

    For your reference:

    Concat and Concatenate functions in PowerApps

    https://docs.microsoft.com/en-us/powerapps/functions/function-concatenate

     

    Regards,

    Mona

  • v-monli-msft Profile Picture
    on at

    Hi @KatieF,

     

    Did my before resolution solve your case? Any update you could share?

     

    Regards,

    Mona

  • KatieF Profile Picture
    18 on at

    Hiya!

     

    Yes it has helped! I took a break from powerapps over christmas as i was getting fustrated with it!!

  • KatieF Profile Picture
    18 on at

    Hiya!

     

    Yes it has helped! I took a break from powerapps over christmas as i was getting fustrated with it!!

  • Tanner Profile Picture
    190 on at

    This solution does not really work beyond 1 through 9; as soon as someone enters "10", it will be formatted as "0010" which is not three digits.

  • xzDan Profile Picture
    350 on at

    How is this?

     

    I have a text box Label1

     

    and Label2's text is set to:

     

    If(Len(Label1.Text)<2,"00" & Label1.Text, Len(Label1.Text)<3, "0" & Label1.Text, Label1.Text)

  • juresti Profile Picture
    319 on at

    You can use this.

     

    You may have trouble if you try to have the control reference it's own text. 

    So you could use a hidden label and set it to the text box's value with the Right() function below which will always be 3 digits. Then use the label as your reference to the other data.

     

    // add leading zeros then trim to keep right 3 digits
    Right(Concatenate("0000", yourControl.Text),3)

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard