cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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!!

Highlighted
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
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Top Kudoed Authors
Users Online
Currently online: 342 members 1,942 guests
Please welcome our newest community members: