Generate ID number

Hi all,

Please could you assist in setting up a new ID depending on another field
If Registration is A, the ID should be sequential, 1, 2, 3
If the Registration is B, the ID should be sequential again but start a new sequence, 1, 2, 3

Establishing sequential numbering across rows is virtually impossible. The reason is that AppSheet is a distributed system which means each user operates on their own complete set of data. Any changes submitted by multiple users are simply applied in the order they are submitted. Last update wins.

So imagine this scenario…User1 and User2 are both submitting Registration A. They both have the latest data indicating the last ID number as 11. They both fill out the Registration and they both are assigned the next ID number as 12. Once they both submit, there will be 2 different rows with the same ID = 12.

The chances of having this problem are small when there are few users but as more users join the app and begin to perform these functions, the occurrence of these duplicated ID’s will be frequent, rendering the sequential ID useless.

My recommendation is to seriously consider WHY you need a sequential ID and determine if it is absolutely necessary. If it is, then you will need to find a creative way to ensure the sequential numbering (it will need be off AppSheet platform as in a Script) …OR… proceed with your original intention understanding that you may need to manually intervene on occasion.

Please let us know your thoughts and then we can help from there.

1 Like