# Unique random string

**URL:** <https://forum.bubble.io/t/unique-random-string/98923>\
**Category:** Need help\
**Created:** [June 25, 2020, 12:52pm UTC](https://forum.bubble.io/t/unique-random-string/98923 "2020-06-25T12:52:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rispoli.mar2803](https://avatars.discourse-cdn.com/v4/letter/r/8e8cbc/32.png) [@rispoli.mar2803](https://forum.bubble.io/u/rispoli.mar2803)\
**Post date:** [June 25, 2020, 12:52pm UTC](https://forum.bubble.io/t/unique-random-string/98923/1 "2020-06-25T12:52:33Z")

</div>

Good evening everyone. I am generating a random string of 7 numbers in bubble through the native function “calculate formula” and save this value in the database. However, I would need this value to be UNIQUE, is there a way or a plugin to assign a random string by doing a check that is not already present in my db? And if it is present, make it generate another automatically?

---

<div class="post-metadata">

**Author:** ![j.hennersdorf](https://avatars.discourse-cdn.com/v4/letter/j/f1d935/32.png) [@j.hennersdorf](https://forum.bubble.io/u/j.hennersdorf)\
**Post date:** [June 25, 2020, 1:06pm UTC](https://forum.bubble.io/t/unique-random-string/98923/2 "2020-06-25T13:06:42Z")

</div>

I have created a file which contains unique random characters. Then I uploaded them into a table “shortcodes” and created a second attribute called “used”. This attribute will be set to TRUE as soon as I have used this item. In my case it was first 100.000 short codes.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/bubble/original/3X/2/8/2847faa74692c2ffa5d939d3dc3724cdd060d247.png) [@system](https://forum.bubble.io/u/system)\
**Post date:** [September 3, 2020, 12:52pm UTC](https://forum.bubble.io/t/unique-random-string/98923/3 "2020-09-03T12:52:33Z")

</div>

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