Trying to create unique order numbers

Hi - does anyone have a simple way of generating unique order numbers?

Was trying to use this solution: Creating random unique IDs that do not duplicate by @daniel10

However, I do not understand why in the ‘only when…’ part of the workflow, the search is set to >1 - shouldn’t it be <1?

My Bubble also doesn’t show ‘endpoint’ when I go into Backend Workflows - it shows API Workflow:

I’d really appreciate any help with this - been struggling for hours.

Thanks!

The “only when” says if you do a search for Suppliers with the randomly generated key and find more than 1, then they do not have a unique key because more than one supplier has it. If that is the case then he schedules the same workflow to run, and it will continue to loop through until the Supplier being passed through is the only one in the database with that key. Also, the endpoint is just the name of the API workflow so in your picture, you have an endpoint and it is ‘assign-order-number’.

1 Like

That makes sense - thank you so much!