Create New Order ID

I need help on Creating a new thing with Order ID starting from 1 (In sequence) using a New Order Button

The very simplistic overview of how to do this in Bubble (which doesn’t account for the very real possibility of duplicates, race-conditions etc.) is just to count the number of things you currently have and add 1.

Or, check for the highest number that already exists, and add 1.

But both of those methods alone can produce duplicates under certain conditions.

To avoid that, you can create a kind of queuing system to ensure only a Single User is processed at a time.

1 Like

How would I be able to do that?

@sendingtms simply call “Do search for Order table” count and “add 1”.

That will definitely cause duplicates eventually.

This topic has been debated on a lot and in my honest opinion, it’s just not worth the trouble to build a sequential number system. Using date/time would be far simpler and still offers somewhat sequential (but logical) IDs.

I just thought of a great idea. I would use the sort by date & time, BUT use the current index as the “Sequence”. Now hopefully this works! :persevere: :crossed_fingers:

This topic was automatically closed after 70 days. New replies are no longer allowed.