Formatting an autonumber [SOLVED]


#1

I’m trying to automate an order ID. So when a new row is added, it is given an automatic ID. The existing ID from pre-AirTable looks like: LS000000

E.g. LS and then six zeros. The first order should look like LS000001, the next order like LS000002 etc

Currently I use:

Field 1 - AutoNumber (AutoID)
Field 2 - Formula = CONCATENATE(“LS00”, (AutoID))

Which gives LS001, LS002 etc. It looks right when we get to LS001000 e.g. all 6 digits now present.

Any ideas how to force the six zeros from the start?


#2

You need to count the ID characters and fill with zeros till 6.

'LS' & REPT(0,6-LEN(CONCATENATE({ID}))) & {ID}


#3

Awesome! Thanks :smile:


#4

Just an alternative solution, for fun:
“LS” & RIGHT ( “000000” & ID )


#5

I don’t understand :thinking:

I think you meant: 'LS' & RIGHT('000000' & ID,6)

A lot cleaner :sweat_smile:


#7

Oups !
Yes that’s it, six digits from the right. !
Sorry !