cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Add Leading Zero's on Number Input

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

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Add Leading Zero's on Number Input

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

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

12 REPLIES 12
Highlighted
Community Support
Community Support

Re: Add Leading Zero's on Number Input

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

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Frequent Visitor

Re: Add Leading Zero's on Number Input

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

Highlighted
Frequent Visitor

Re: Add Leading Zero's on Number Input

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

Highlighted
Community Support
Community Support

Re: Add Leading Zero's on Number Input

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

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Community Support
Community Support

Re: Add Leading Zero's on Number Input

Hi @KatieF,

 

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

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Frequent Visitor

Re: Add Leading Zero's on Number Input

Hiya!

 

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

Highlighted
Frequent Visitor

Re: Add Leading Zero's on Number Input

Hiya!

 

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

Highlighted
Advocate V
Advocate V

Re: Add Leading Zero's on Number Input

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.

Highlighted
Resolver III
Resolver III

Re: Add Leading Zero's on Number Input

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)

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (6,659)