Calculate A Random String Produces the same string if under the same workflow

Hi Bubblers!

I’m having issues with the action calculate a random string

If two calculate a random string is in the same workflow, it produces the same string.

Even if they are separate actions, they still produce the same string.

Here’s a detailed explanation:

On page load, I have a workflow with 2 actions that generates a random string for 2 custom states



Off the top of my head, I assumed these two actions would produce different strings since, well, they are different actions, right? But that doesn’t seem to be the case. It turns out that if both calculate a random string actions are under the same workflow, they will produce the same strings.

Sure, I could set up two on page load workflows and separate these two actions, which by the way, works. But I have other two states that are not accessible since their elements are in a repeating group which I use the orchestra plugin to access them. So setting up a different workflow but with the same action is out of the equation.

I have also tried adding a pause before the next action but it doesn’t work as well.

Regardless of the other two elements, this action SHOULD generate different strings.

Would greatly appreciate any help or tips. :pray:

This indeed does happen, it’s incredibly annoying. My solution was run it as a backend workflow recursively. Database trigger may also work. However there are random generator plugins that work as well as.

1 Like

Appreciate the response Chris @chris.williamson1996

Unfortunately, running it as a backend WF and database triggers won’t be good for me since these are only states.

Can I please ask you to share the name of plugins that you would recommend? If possible, I want to use what you are using / have used. Don’t want to go through the hassle of testing broken plugins. Would greatly appreciate it…

This is a basic feature and should work separately per action. I hope Bubble does something to optimize this.

Admittedly this does sound like a bug and worth submitting here: Support | Bubble

If I can offer a suggested workaround - could you try on the second string, instead of another ''calculate RandomString" you instead ‘Set State’, value = ‘Result of Step 1 (create a RandomString)’ - and then do a calculation on that to end up with a different number?

Why don’t you just use a UID or GUID plugin to get a unique ID?

1 Like