Pick random record solution

Hi All!
I want do demonstrate different phrases to user after actions in app.
So i generate few variants of short phrases with Ai and make separate table with them.

But how to randomize choise of row to show notification?

what i did looks for me not so best solution. Maybe i can have good advise.

Here is my solution:
I add table with columns - “phrase” and “nr” with 60 variants of fhrases and numbers 0-59

In user table i add columns:
:one:"current second" - math column with formula Second(now)
so it shows different values from 0 to 59 each second.
:two:rel_Phrase - relation “current second” → “nr” from phrases table (1 value)

:three:lookup_phrase - lookup from rel_Phrase which gives different text each second.

And so in all action workflows i add action “show notification” from user profile column lookup_phrase.

Now any time users do actions they receive different variants of praise phrases.

There is an action called shuffle order. Did you try that?

Else, you could use the single value column and get a random value.

I can’t recall when the random value would get “recalculated” using that method. I’m thinking of using Roll Dice with the seed being the current time.

1 Like

You are right.

Actually no you are not. I was able to refresh single value random by using the shuffle order action :smiley: niiice

I mean I don’t recall when it would be “recalculated”, not stating a fact.

Oh okay sorry!

1 Like

looks like my solution is best one, except i add roll dice column based on time column so i can have more numbers than 60

oh no, roll dice have same outputs with same seed values… need more random

Add a template combining the current time with the rowID, I think.