If I needed to create a unique numerical code for an item, what would be the best way to go about doing that without doing a search for every time a new number is generated?
I thought about generating a list using another service then importing the list. The only issue being if I run out of codes I need to generate more codes excluding the ones already created.
How about alphanumeric strings that are at least a certain length using Bubble’s “Generate random string” under “Calculate formula”? Before the string is allowed to be used, check if it was already stored in the database.
To get around the same Random String in the same workflow, I use a Custom Event that gets triggered when there is a duplicate.
In the Custom Event I do another Random String generation.
I noticed when I tested this that Bubble does have a preference for specific values when it randomly generates, so in the ‘Custom Event - Recalculate’ I made the string 1 value longer to try and reduce that chance it generates a duplicate. Although not 100% foolproof