No rush at all! You are a true king. Thx Justin.

Best,

Michiel

No rush at all! You are a true king. Thx Justin.

Best,

Michiel

Sorry for the delayed response. Work has been keeping me very busy, and I havenât had time to put into working on the solution youâre seeking. Have you been able to get it working on your own, or do you still need assistance?

Yes, please. If you have time to have a look, would be very helpful. Thx!

Is there any easy way to adapt this to repeating unto 999? SO 1000 starts at 1 again?

Thank you!

Thatâs definitely doable, although mathematically it doesnât make sense to have 1000 turn into 1, and I couldnât get this to work cleanly in a formula considering how the numbering system is currently created. However, 1001 could become 1, as could 2001, 3001, and so forth; i.e. resetting to 1 *after* each multiple of 1000 has passed.

If that works for you, read on. If notâŚumâŚI guess you could read something else?

This is accomplished by tweaking the formula in the `{Variant}`

field. The current formula is:

```
(LEN(Truncated) - LEN(Substitute)) / LEN({Unique Base})
```

Hereâs the modified formula that cycles back to 1 after each multiple of 1000:

```
MOD((LEN(Truncated) - LEN(Substitute)) / LEN({Unique Base}) - 1, 1000) + 1
```

However, that cycling behavior kind of defeats the purpose of the setup, which is to create a reliable count of specific items. If youâre tracking something so plentiful that youâve got 1000 of them, why would you want the count for that item to restart at 1? Are these items disposable. so that by the time you get to 1000, whatever was numbered 1 doesnât exist any more, and itâs safe to reuse that number?

Haha, it doesnât quite work, but I read on anyway

The point is to not get to a four digit number. I just realized, I probably could just take the right 3 digits using the RIGHT() function. I donât mind having a 000 number. Also, you are exactly right, by the time I get to 1000, I donât expect to be needing the first iteration of 001. This is being concatenated to the name of the linked record and I expect the linked record to only go up to 10, but am trying to be robust. The problem is, I donât want to have an infinite number of IDs to concatenate.

If I have 1000 records, then link 10 records to each of them, then the Auto ID would get to 10,000. However, I really only need it to go to 100. Itâs not a big enough deal for me to be willing to implement another table to iterate the record numbers like another example you have created. So I figured this was a reasonable and robust enough work around to keep each record name unique and readable.

Using RIGHT() wasnât quite that simple, haha. I had to first convert the nubmer to a string using the Arrayjoin() funciton. Then use a combination of MIN() and LEN(), because RIGHT() doesnât work if the input string is shorter than the number of characters you are asking for. But I for the result I was looking for

autoIDString

ARRAYJOIN({autoID})

Number

RIGHT(autoIDString,MIN(LEN(autoIDString),3))

IF({Number}, IF({Number}<10, â00â & {Number}, IF({Number}<100, â0â & {Number}, {Number})))

There are a few hiccups in your attempt to add leading zeroesâŚ

The `ARRAYJOIN()`

function is designed to work on arrays, but the `{autoID}`

field returns a number. I get the impression you just want to convert that number to a string, so all you need for that is to concatenate the number with an empty string:

```
autoID & ""
```

The rest of the process to add leading zeroes to the number can also be greatly simplified. You only need a single formula. Hereâs what I often use when thatâs needed.

```
REPT("0", 3-LEN(autoID & "")) & autoID
```

Broken down, that takes the autoID value, converts it to a string, subtracts the length of that string from 3 to see how many leading zeroes are needed, repeats the â0â character that many times, and concatenates that with the original number.

You show great refinement in your work! I never considered using the REPT() function. I did have to make one adjustment. You canât just feed autoID in, because once the numbers get above 5 digits long the REPT function returns an error. I am guessing this has to do with itâs ability to take negative values. Instead I used the Number field, which already reduces the auto ID to a maximum of 3 digits. Of course, this could be done in a single formula, but I like to break them out at first:

autoIDString

{autoID} & ââ

Number

RIGHT(autoIDString,MIN(LEN(autoIDString),3))

REPT(â0â, 3-LEN(Number& ââ)) & Number

Here is the single formula version

REPT(â0â, 3-LEN(RIGHT({autoID} & ââ,MIN(LEN({autoID} & ââ),3))& ââ)) & RIGHT({autoID} & ââ,MIN(LEN({autoID} & ââ),3))

I get where youâre going now, and can offer one more optimized version of your formula.

```
REPT("0", 3 - LEN(MOD(autoID, 1000) & "")) & MOD(autoID, 1000)
```

The `MOD(autoID, 1000)`

portion automatically reduces the numberâno matter how largeâto no more than three digits: the remainder after dividing the number by 1000.

On a side note, you used `Number & ""`

in part of your formula, but the concatenation with the empty string isnât necessary there. Thatâs only required to take a non-string value and turn it into a string, but your `{Number}`

field already created a string (the clue: left justification of the output means itâs a string; right-justification, as in the `{autoID}`

field, means itâs a number).

This is perfect! Thanks!!

Hey @Justin_Barrett, thank you for your amazing work here !

Iâm using this method to make a pallet tracking base, where there is pallet 1 of 2, 2 of 2 etcâŚ

The issue I have is there is almost 12k pallet to track and each one is created via a script from the customer database and I wonât be on the field to do the trick and each pallet must be linked to the controler manually. (Iâm fairly new to the airtable world) I tried some sort of wizzardry with zappier to automatically link every new record created, but it doesnât works.

Is there a way to easilly link every new record created to the controler ?

Welcome to the community, @Thibaut_FERRI! Iâm a little less inclined to use this system these days thanks to Airtableâs scripting and automation features, but itâll still work if you want to use it. In terms of linking every new record to the control record, this can be done using Airtableâs automation system.

The trigger will be the creation of a new record. The action step will be an âUpdate recordâ action, where you update that record with the link to the desired control record. You can get the control recordâs ID by right-clicking on it and choosing âCopy record URLâ. In the automation update step, paste that full URL into the link field youâre updating, then delete everything except the actual record ID (e.g. recXXXXXXXXXXXXXX). Save and activate the automation, and all new records will auto-link to the control record.

Thank you very much, great community !

I still have a little issue with this one :

Iâd like to update the record in the control table when a record is created in the Etiquettes table. as you said Iâve used the control recordâs ID in the record id field, but what to put in the fields âetiquette fieldâ ?

On the etiquette table, the link to control is named âLink2Controlâ

Cheers guys, thankâs for the support =)

The value in the âRecord IDâ field of the action should be the record ID from the record that triggered the automation. Delete that current value, then click the + symbol on the right end, and pick the triggering recordâs record ID.

Thank you for your time, patience and explanations.

I figured I went the other way around (tried to update the control record instead of the created one).

Iâm still struggling a bit with english as itâs not my mothertongue.

Once again, thank you for your work.

Cheers from the land of the baguette.