New Plugin: UniqueID

UI%20logo%20square

UniqueID plugin

When having a unique id value is a must.

Two flavors available:

  1. UniqueID’s
    Used to check for uniqueness when inserting things with an ID from an external source

  2. UniqueCounter’s
    Used to generate a unique ID value from an auto incrementing counter

Full documentation found HERE

Search for UniqueID to install this free plugin.

Note, This plugin utilizes a database external to Bubble to create and track values.

The documentation has lots of details, but basically you:

  • Create a “service account” which establishes a user name and password for the service (You can use the demo page or an action within your own app to do this)
  • Create either a UniqueID or a UniqueCounter using an action within your own app. This creates the field and thus is done only once per field.
  • You then can check/generate values based on your needs using workflow actions and external api retrieval.

Happy to answer any questions here in the forum.

15 Likes

Interesting, thanks. If two simultaneous calls are made, two different id will be generated and incremental? It is the principal reason having created this plugin?
And my second question is what’s the chance the external server crash or will not be available? weird question :slight_smile:
john

Hey @JohnMark

Correct, if two simultaneous calls are made, two different id’s will be generated when using the UniqueCounter flavor. I created this portion of the plugin for generating invoice id’s, order id’s, etc. where you want something unique, but also something presentable to the user. It’s pretty easy to create a race condition in Bubble, hence the need if you have any type of load.

The second flavor, UniqueID, was created to deal with incoming webhooks. In my case I had a stream of webhooks coming in from Eventbrite, which caused me to do all sorts of tricks to avoid dupes. So this flavor takes an ID value and inserts it into index, so that if a second call comes in at the same time, it will fail.

Second question is not weird at all, and definitely a risk. The plugin makes calls to an endpoint that resides on a Google Cloud Compute linux instance, so very reliable. That being said, I don’t have automated failover’s in place right now.

3 Likes

Great!

1 Like

This is obviously very useful.

But, I’m building an app for a funded company… And if this thing fails I would be screwed. What option would I have to host it myself somehow so I can control the code? It would be irresponsible of me to let a tiny piece of code jeopardize the whole operation.

Hi @ryan16,

You can use the UNIX DateTime buffer instead, it will always be different as it is in micro-seconds. With this method you get an different unique ID.

1 Like

Thanks.
It turns out that there’s already a unique_id field for every table, although the ids are crazy long, it should be usable I believe.

1 Like

Hey All,

I haven’t been around here for several years, but was just notified that this plugin was temporarily inoperable. Sorry to anybody impacted by that! It is back online now.

To anybody using this plugin, please migrate to a new solution asap. The outage was triggered by the deprecation of the server it is running on. I completely forgot about the plugin’s need for the server as I no longer use Bubble.

At any rate, I can keep that server online for another couple months, but I will be shutting it down in Q1 next year.

1 Like

Maybe @levon wants to take it over?