Make Sequence of uniqueid based on previous last 4 numbers of unique id

I want to create unique id (KEY) look like this:

I already got the formula using IFS, which is:

IFS([Category] = “Job Request”,CONCATENATE(“IPD-JRR-”,TEXT(TODAY(), “YYYYMM”), “-”,(NUMBER([_Rownumber] - 0001))),

[Category] = “Incident/Accident”,CONCATENATE(“IPD-ORA-”,TEXT(TODAY(), “YYYYMM”), “-”, (NUMBER([_Rownumber] - 0001))),

BUT MY PROBLEM IS THE DATA LOOK LIKE THIS:

I WANT IT TO BE LIKE THIS:

IPD-JRR-202601-0001

IPD-JRR-202601-0002

IPD-JLT-202601-0003

PLEASE HELP ME WITH THIS. THANK YOU

Just for the expression sake , please try an expression something like

IFS([Category] = “Job Request”,CONCATENATE(“IPD-JRR-”,TEXT(TODAY(), “YYYYMM”), “-”, (RIGHT(CONCATENATE(“0000”,([_Rownumber] - 1)),4))),

[Category] = “Incident/Accident”, CONCATENATE(“IPD-ORA-”,TEXT(TODAY(), “YYYYMM”), “-”, (RIGHT(CONCATENATE(“0000”,([_Rownumber] - 1)),4))),

However please be aware that unless the app is a single user app or the records will be added by only one user in your app , the serial number system will almost invariably fail in a multi user app in AppSheet

Also your serial numbers are based on [_ROWNUMBERS] which can also fail in case of deleted records because that row number will be unused in record key generation.

1 Like