Auto increment in bubble

Thank you for this tip, @evanlitttle – this is just what I was looking for. Basically instead of a completely random string, I needed an auto-incremented, yet unique, number series and this solution helps get that.

However, while I was thinking about this further, I’m envisioning a scenario wherein if items are deleted from the database, for whatever reason, then this approach will generate conflicting numbers since it’s based on count. For e.g. if I have 14 items in my database, then adding a new product gives me products:count + 1 = Product ID = 15. But if I end up deleting a product from my database table (from somewhere in the middle of the table), then I’m back to having a total count of 14, and the next Product I’ll add will be assigned the number 15. Is there a workaround to this particular scenario using the approach you mentioned?

Thanks a ton once again.