cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Responsive Resident
Responsive Resident

format fixed length number

 

I was using the Text(number,000) for formatting data except I found that it is for display purpose.

It won't save your data with that format.

 

Instead I started using Right(Concatenate("0000",number),6) since I need 6 digits.

 

This is going directly into a Patch column on a CDS database.

 

02.PNG

03.PNG

 

No leading zeros saved, unless I use Right(Concatenate("0000",....... This one works correctly.

 

Am I understanding this correctly? The Text is only for display purposes and not for appending leading zeros while saving the data.

 

5 REPLIES 5
Super User III
Super User III

Hello @juresti ,

I will get one question out of the way first.

Is your destination field a text or number field?

 

Responsive Resident
Responsive Resident

 

It is a text field.

 

I think I'm understanding it correctly because excel also has a similar format formula, but it's just for display and shows leading zeros, then when you click the cell, it does not have zeros.

 

It must be the same thing.

 

 

OK thanks @juresti ,

I am not on my PC so cannot test this, but maybe

Right(Concatenate("0000",Text(number,"######"),6)

or something along that line may be worth a try.

Another thought - a type conversion to a number and then back to Text.

Text(Value(txtObserverEID_1.Text),"000000")

may get the bit you concatenate onto.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Community Support
Community Support

Hi @juresti ,

Actually, it is an known issue within Excel table -- When patching Number formatted Text value (using Text function) back to Text column or Number column, the 0 (zero) before the positive number (1,2,3,...) within the value would be recognized as a invalid value, and would be removed from the saved value automatically.

 

As an alternative solution, I agree with your though almost. The combination of Concatenate function and Right function could achieve your needs.

You could also consider take a try with the following formula:

Patch(Table1, Defaults(Table1),{TextColumn: Left("000000",6-Len(TextInput1.Text)) & TextInput1.Text })

 

In addition, you could consider add a SP List as your data source instead of the Excel table. The Text() function would work in Single Text type column in SP List without above issue you mentioned.

 

Best regards, 

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

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

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