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
4 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

First of all Iā€™m sorry for replying on this old topic! :slightly_smiling_face: But thought to share this here that may help!

You can make a Random Swiper using the Roll Dice column that mentioned above by Darren and Gustavo!

Hereā€™s how! : Random Swipe?

Thank you

Is there a way to change the random values every 10 minutes, can something else be used instead of current time?

Try this as a seed value for a random number. It will only change every 10 minutes. ā€˜nowā€™ refers to the current datetime which you can select as a replacement value.

(trunc(now)*1000)+
(hour(now)*10)+
floor(minute(now)/10)

2 Likes

Hi I want to know if itā€™s possible to generate a number per row but not randomly, like 01, 02, 03ā€¦?

I think you want use case #2 in the attached thread.

1 Like

Thank you sooo much

1 Like

Hi, I think I canā€™t make this solution because when I use a template I canā€™t search my value because itā€™s not in the User table. I donā€™t know if itā€™s clear. I wanna make that idea but for my inventory like object 1,2,3 etc but the number never change even I delete an row or add one.
Thanks.

@Camille1, could you show your setup with some screenshots or from a video? The method that Darren used ( thanks to @11183 ) in the topic that Jeff linked should work!

1 Like


I want to create a number ID for each row of ā€œRAPPORTSā€ so I create a Row ID but I canā€™t choose it when Iā€™m in the ā€œassorted-monthā€ table.

You need to display like 1,2,3,ā€¦ in the RAPPORTS table right? In that table now you can create a Lookup column like this :

image

and you can create the Row Index column like this :

and finally you can create a Math column like this :

Thank you for your fast answer! Iā€™m so sorry but I want to make the case 1 with unique ID when I make a new row that never change ā€¦ But your answer was so clear thank you again