Random number

Hello

Do you know a line of code to make a random number appear in a line?
For example I would like that with each click, a new number appears on my page between 1 and 89 for example? How to do ? Thank you

You can use the Dice Roll plugin column for this. Set it up as follows:

  • Create a User Specific Text column to hold a “seed” value
  • Create the Dice Roll plugin column
    – Use the Seed column as the Seed value
    – Set the number of sides to 89
  • Add a Button to your screen with an action that does a Set Column values on your Seed column, using the Unique Identifier special column value
  • Add a text component (or whatever) to display the value of the Dice Roll column
3 Likes

Hola!

Just to complement the Darren’s solution: if you want to have a random value based on time automatically (without pressing some button), all what you need to do is this:

image

image

With it, every 10 sec you will have a new value automatically.

Feliz día!

perfect thank you very much.
It’s possible to have a different value on each line? If yes, how do ?
thank you

I think so!

Let me try/look for a smart way.

I think the obvious way would be to create a template using the RowID + current timestamp, and then use that as the seed value.

1 Like

Here is the solution using Darren’s suggestion:

  1. image

  2. image

  3. image

Saludos!

1 Like

Thanks a lot of!
I wanted to try this to randomize my Swipes but it doesn’t work.
indeed I use the swipe model but it arranges the articles only compared to the table.
do you still have a solution? thank you