Save the date! Join us on October 16 for our Product Ops launch event. Register here.
May 30, 2019 12:20 AM
Hi,
I am creating a client job tracker and would like to autogenerate 4 digit numbers, eg. 0001, 0002.
Can someome please help as I can only get a single digit or decimals so far.
Thanks Daz
May 30, 2019 12:42 AM
Hi @Darren_Ledwich - you need an autonumber field (which you can then hide), then create a formula field using this:
REPT('0', (4 - LEN({ID} & ''))) & ID
JB
May 30, 2019 12:58 AM
Jonathan that is brilliant.
Thanks so much for the quick response too.
Daz
Aug 15, 2019 09:51 AM
This is close to what I am looking for, but I’m not advanced enough to deconstruct that formula.
Is there a way to customize an alphanumeric code with some static characters… Example: In Excel, I can enter “3.1-001” into a cell, then “3.1-002” in the next, then auto-populate the rest of the cells. Is there a workaround/solution for this?
Aug 15, 2019 12:32 PM
Just use the formula that @JonathanBowen provided and add some text at the beginning.
For example, if you want the alphanumeric code to start with “3.1-”, then use this:
"3.1-" & REPT('0', (4 - LEN({ID} & ''))) & ID
The number 4 is used to calculate the number of times that the text ‘0’ is repeated.
If you want more zeros, you can use a higher number in the formula.
Aug 15, 2019 01:59 PM
Excellent. That’s simple. Thanks.
Mar 14, 2022 08:47 PM
Very helpful. It’s fine, but…
LEN({ID} & ‘’)
Why does it not work without blanks? :thinking: