Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
ShowAll Questionssorted byDate Posted
Sourav P

# To get the prefix "000" in the text data type field

Hi,
I have a text field " Endos Count" which is a counter field. But the format of the count i need is, 001,002,003 etc. Now i am getting as 1,2 3. Can anyone suggest plz, how to get this type of format.
I just wrote the below formula, but its not working,
TEXT(VALUE(Endorsement_Count__c)+001)
Best Answer chosen by Sourav P
Tarun J.
Try using:
'00'+TEXT(VALUE(Endorsement_Count__c))

But in this case, it will always show 2 leading 0's in your field.

You can add more logic in it by adding IF conditions which checks if Endorsement count is greater than 9 and less than 100, add only one leading zero and so on.

-Thanks,
TK

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.

Suresh(Suri)
Hi Sourav,

Try in your text formula field like
"000" & Endorsement_Count__c
Sourav P
Hi Suresh, Thanks, Let me try this.
You mean , like TEXT(VALUE("000" & Endorsement_Count__c)+001)
Tarun J.
Try using:
'00'+TEXT(VALUE(Endorsement_Count__c))

But in this case, it will always show 2 leading 0's in your field.

You can add more logic in it by adding IF conditions which checks if Endorsement count is greater than 9 and less than 100, add only one leading zero and so on.

-Thanks,
TK

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.
This was selected as the best answer
Sourav P
Hi Tarun, The above didnt satisfied my need as its always show two zero.
But i try using the below with IF logic as suggested and it worked. Thanks
Charalambos Dimitracopoulos
• your numbers can be 1, 2, ..., 999
• add 1000 to your numbers so that you have 1001, 1002, ... , 1999
• convert the numbers to text so that you always have a 4 character string
• use mid formula to take the sub-string from the 2nd up to 4th (included) characters of the 4 character string
• merge the result with "000" in a logic "000"&result