Repeatable slug values

Hi so when a user makes a thing there is a workflow that creates a slug value for it which I used “‘Calculate Formula’ Random value 6 characters”. I do this so that I can search for these specific things on an employee only page.

My worry is that if I do the random value calculator it might make the same value for two different slugs (i.e. 123456 for the first things slug and 123456 for the second things slug). Is this possible? Should I worry about it?

There’s an action called slug not possible. This checks for duplicates in the db. Or you can automatically assign random number + 1.


Twitter: @bestbubbledev
Youtube: Best bubble developer
LinkedIn: Gio Kakhiani

Of course it’s possible to generate the same random code twice…

And if you’re not doing anything to check for duplicates then it’s definitely possible to store duplicate codes on things in you database…

That said, as far as I know Bubble won’t let you set a slug to an existing value (instead it will append a number to the end)…

But, do you even need to use slugs here (if you’re just setting a random value)? What exactly is the purpose?

Hi, I am using the slug value, I didn’t know it would append it. Thank you for telling me @adamhholmes and @bestbubbledev .

Im doing it to search through different things in DB that all have repeating values in their fields so I would like a slug so that I know I am referencing the right thing when I modify them.

Thanks!

Hey @anon31591471, I might be missing out on something here but isn’t the thing’s unique ID enough for this? You can still refer to a specific item if you use unique id…

Plus, you’re already generating a random string for your slugs so why not use unique ID instead?

I tried but I am using a searchbox to find the things and ‘Unique ID’ was not an option to search by unfortunately. That was my first thought too.