Help

Save the date! Join us on October 16 for our Product Ops launch event. Register here.

Enforce leading zeros

7353 3
cancel
Showing results for 
Search instead for 
Did you mean: 
nnnnneil
8 - Airtable Astronomer
8 - Airtable Astronomer

I have a pre-existing order number in the format of “LS003456” that I would like to auto-generate. I’m using a second field with autonumber and then a formula like this:

CONCATENATE(“LS00”, AutoID)

which gives a result of:

LS00185
LS00186
LS00187

Is it possible to modify the formula so that there are always 6 digits after the “LS” and any leading zeros are maintained?

My end goal is to have a sequence like:

LS000001
LS000002
LS000003

LS999999

3 Replies 3

Use this formula:

'LS'&
REPT(
    '0',
    6-LEN(
        AutoID&''
        )
    )&
AutoID

Tnx! This solved my problem as well. :slightly_smiling_face:

I just found this answer that also works so well and I find it more elegant

RIGHT(“000”&{Revision Level},3)