How to achieve Unique, Sequential Numbers Reliably?

:boom: A WORD OF WARNING THAT SOME OF THE SOLUTIONS PEOPLE OFFERED ABOVE ARE NOT RELIABLE AND YOU MAY, IN FACT, GET DUPLICATES OR WORSE UNLESS YOU USE THE FOLLOWING METHOD AS - I HAVE TESTED THEM ALL JUST LIKE KEITH DID :boom:

Not knowing this caused me a lot of issues and setbacks so I hope it saves others. The solution that works perfectly and reliably in bubble natively is the solution buried at the end of Keith’s great video - and all the reasons are explained by him.

in summary the solution is:

Lets say you want unique, sequential order numbers that increment by 1

  1. Create a backend workflow that triggers on a new database trigger event (in my case an order)
  2. Make changes to the order “order now” where it does a search for all orders that have a creation date less than or equal to “this orders creation date” (MAKE STATIC) count +1

That’s it!
As I said, the reasons why this works (and nothing else does) is in Keith’s video if you want to know why.

Of course there are other solutions by using plugins that reference an external API but if you want a reliable, simple, native sequential order number then there you have it.

Screenshot 2020-06-11 15.51.17

24 Likes