cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
KatieF
Level: Powered On

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
Community Support Team
Community Support Team

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
Community Support Team
Community Support Team

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.
KatieF
Level: Powered On

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

KatieF
Level: Powered On

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

Community Support Team
Community Support Team

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

Community Support Team
Community Support Team

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.
KatieF
Level: Powered On

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!!

KatieF
Level: Powered On

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!!

Tanner
Level 8

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.

xzDan
Level 8

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
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (8,456)