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.
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.
Hello @juresti ,
I will get one question out of the way first.
Is your destination field a text or number field?
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.
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,
User | Count |
---|---|
125 | |
87 | |
87 | |
75 | |
69 |
User | Count |
---|---|
215 | |
181 | |
140 | |
97 | |
83 |