Autogenerated running number

I want to create an autogenerated field to number the entries consecutively without breaks.
This is independently of the autogenerated field ID and it’s used to number the activates of a project.

The next entry should follow the previous one, disregarding any deletions.
Example:
I have 3 records with their entries numbered:
01, 02, 03
If the last record is deleted, the sequence is broken.
Lets say I delete 03 above, the next entry will be 04, when it should be as per my requirements 03.

So…

original sequence for this field is 01, 02, 03
delete last entry 03 (this case only happens if a user enters wrong data and deletes the record)
Next sequence is 01, 02, 04 when I need it to be 01, 02, 03 (new record should continue counting from previous one).

Is there a way to solve this?

Hi,

Regarding resetting auto-generated sequence, please refer to this article:
https://www.ragic.com/intl/en/doc/19/Auto-generated-field-values#3

You could enter the sequence number you want to start from and click the Set seq of next record button under design mode.

1 Like

If you are looking to have this done automatically, it sounds like a simple javascript loop which would go through all the records and number them sequentially.

If you need it to happen when deleting a record, I would suggest that instead of just deleting, you use an action button that deletes the record and then runs the loop.

1 Like