# Random number

**URL:** <https://community.glideapps.com/t/random-number/40575>\
**Category:** Ask for Help\
**Created:** [April 10, 2022, 8:47am UTC](https://community.glideapps.com/t/random-number/40575 "2022-04-10T08:47:23Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Monsieur\_Baillieul](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/monsieur_baillieul/32/36815_2.png) [@Monsieur\_Baillieul](https://community.glideapps.com/u/Monsieur_Baillieul)\
**Post date:** [April 10, 2022, 8:47am UTC](https://community.glideapps.com/t/random-number/40575/1 "2022-04-10T08:47:23Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [April 10, 2022, 9:17am UTC](https://community.glideapps.com/t/random-number/40575/2 "2022-04-10T09:17:09Z")

</div>

You can use the [Dice Roll](https://www.glideapps.com/plugins/dice) 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

---

<div class="post-metadata">

**Author:** ![gvalero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gvalero/32/1037_2.png) [@gvalero](https://community.glideapps.com/u/gvalero)\
**Post date:** [April 10, 2022, 2:44pm UTC](https://community.glideapps.com/t/random-number/40575/3 "2022-04-10T14:44:26Z")

</div>

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](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/3/9/393b9f0d59b2213ffe9dbe6e28729142ab438aa6.png)

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/2/a/2a476265447cc2a89b7c78157a1693f4b3ecfe04.png)

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

Feliz día!

---

<div class="post-metadata">

**Author:** ![Monsieur\_Baillieul](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/monsieur_baillieul/32/36815_2.png) [@Monsieur\_Baillieul](https://community.glideapps.com/u/Monsieur_Baillieul)\
**Post date:** [April 10, 2022, 3:07pm UTC](https://community.glideapps.com/t/random-number/40575/4 "2022-04-10T15:07:35Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![gvalero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gvalero/32/1037_2.png) [@gvalero](https://community.glideapps.com/u/gvalero)\
**Post date:** [April 10, 2022, 3:35pm UTC](https://community.glideapps.com/t/random-number/40575/5 "2022-04-10T15:35:07Z")

</div>

I think so!

Let me try/look for a smart way.

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [April 10, 2022, 3:36pm UTC](https://community.glideapps.com/t/random-number/40575/6 "2022-04-10T15:36:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![gvalero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gvalero/32/1037_2.png) [@gvalero](https://community.glideapps.com/u/gvalero)\
**Post date:** [April 10, 2022, 3:47pm UTC](https://community.glideapps.com/t/random-number/40575/7 "2022-04-10T15:47:02Z")

</div>

Here is the solution using Darren’s suggestion:

1. ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/2/c/2c21630abc55aff27e94211bdc3dac0e001ebf77.png)

2. ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/d/9/d9d181c81838e50497ab05ae5181c400c8958e7c.png)

3. ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/d/7/d71f28dfb04b41f61c62e5d2b91181066664bda1.png)

Saludos!

---

<div class="post-metadata">

**Author:** ![Monsieur\_Baillieul](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/monsieur_baillieul/32/36815_2.png) [@Monsieur\_Baillieul](https://community.glideapps.com/u/Monsieur_Baillieul)\
**Post date:** [April 10, 2022, 4:11pm UTC](https://community.glideapps.com/t/random-number/40575/8 "2022-04-10T16:11:16Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Dilon\_Perera](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/dilon_perera/32/85652_2.png) [@Dilon\_Perera](https://community.glideapps.com/u/Dilon_Perera)\
**Post date:** [May 27, 2022, 12:16pm UTC](https://community.glideapps.com/t/random-number/40575/9 "2022-05-27T12:16:09Z")

</div>

First of all I’m sorry for replying on this old topic! 🙂 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?](https://community.glideapps.com/t/random-swipe/41800)

Thank you

---

<div class="post-metadata">

**Author:** ![Rashmi\_Sinha](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rashmi_sinha/32/54160_2.png) [@Rashmi\_Sinha](https://community.glideapps.com/u/Rashmi_Sinha)\
**Post date:** [February 23, 2023, 11:13pm UTC](https://community.glideapps.com/t/random-number/40575/10 "2023-02-23T23:13:01Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [February 23, 2023, 11:54pm UTC](https://community.glideapps.com/t/random-number/40575/11 "2023-02-23T23:54:15Z")

</div>

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.

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

```

 ![Screenshot_20230223-175139](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/4/8/48bf9f964911c568164fd34d3ef688e60fc132b8.jpeg)

---

<div class="post-metadata">

**Author:** ![Camille1](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/camille1/32/56100_2.png) [@Camille1](https://community.glideapps.com/u/Camille1)\
**Post date:** [March 23, 2023, 1:02pm UTC](https://community.glideapps.com/t/random-number/40575/12 "2023-03-23T13:02:40Z")

</div>

Hi I want to know if it’s possible to generate a number per row but not randomly, like 01, 02, 03…?

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [March 23, 2023, 1:18pm UTC](https://community.glideapps.com/t/random-number/40575/13 "2023-03-23T13:18:00Z")

</div>

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

> [@How do I create an auto-incrementing row number with Glide Tables?](https://community.glideapps.com/t/how-do-i-create-an-auto-incrementing-row-number-with-glide-tables/39572):
>
> This is a question that comes up a lot, so creating this topic to use as a reference. Typically, there are two distinct use cases when it comes to auto-incrementing row numbers. Use Case 1: – We need to generate a Part Number, or an Order Number, or an Employee ID. Once the number is generated, it should never change, even if rows are deleted. – The general approach for this use case is to maintain a static counter, use it to craft a suitably formatted ID, and increment it by one every time…

---

<div class="post-metadata">

**Author:** ![Camille1](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/camille1/32/56100_2.png) [@Camille1](https://community.glideapps.com/u/Camille1)\
**Post date:** [March 23, 2023, 1:59pm UTC](https://community.glideapps.com/t/random-number/40575/14 "2023-03-23T13:59:38Z")

</div>

Thank you sooo much

---

<div class="post-metadata">

**Author:** ![Camille1](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/camille1/32/56100_2.png) [@Camille1](https://community.glideapps.com/u/Camille1)\
**Post date:** [March 24, 2023, 10:40am UTC](https://community.glideapps.com/t/random-number/40575/15 "2023-03-24T10:40:49Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Dilon\_Perera](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/dilon_perera/32/85652_2.png) [@Dilon\_Perera](https://community.glideapps.com/u/Dilon_Perera)\
**Post date:** [March 24, 2023, 12:07pm UTC](https://community.glideapps.com/t/random-number/40575/16 "2023-03-24T12:07:18Z")

</div>

@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!

---

<div class="post-metadata">

**Author:** ![Camille1](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/camille1/32/56100_2.png) [@Camille1](https://community.glideapps.com/u/Camille1)\
**Post date:** [March 24, 2023, 12:31pm UTC](https://community.glideapps.com/t/random-number/40575/17 "2023-03-24T12:31:32Z")

</div>

![Screenshot 2023-03-24 at 13-28-36 HBPMtech · Glide](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/f/c/fc4d069981d0ff5e849025a8aba299e02fbe986c.png)  
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.

---

<div class="post-metadata">

**Author:** ![Camille1](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/camille1/32/56100_2.png) [@Camille1](https://community.glideapps.com/u/Camille1)\
**Post date:** [March 24, 2023, 12:32pm UTC](https://community.glideapps.com/t/random-number/40575/18 "2023-03-24T12:32:09Z")

</div>

![Screenshot 2023-03-24 at 13-27-59 HBPMtech · Glide](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/6/3/63c80751b972b417d92df656cf26fe4c3d1c0105.png)

---

<div class="post-metadata">

**Author:** ![Dilon\_Perera](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/dilon_perera/32/85652_2.png) [@Dilon\_Perera](https://community.glideapps.com/u/Dilon_Perera)\
**Post date:** [March 24, 2023, 12:46pm UTC](https://community.glideapps.com/t/random-number/40575/19 "2023-03-24T12:46:26Z")

</div>

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](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/5/b/5bc0810d2a0c5ee4ba0ee422d97b00e342bc231e.png)

and you can create the Row Index column like this :

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/0/2/02ce5e489db0851745f8316034758b1df7221b02.png)

and finally you can create a Math column like this :

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/9/4/94141d721e24e0978a383e4b483e8ed66b02f40f.png)

---

<div class="post-metadata">

**Author:** ![Camille1](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/camille1/32/56100_2.png) [@Camille1](https://community.glideapps.com/u/Camille1)\
**Post date:** [March 24, 2023, 1:00pm UTC](https://community.glideapps.com/t/random-number/40575/20 "2023-03-24T13:00:30Z")

</div>

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

[Next page](https://community.glideapps.com/t/random-number/40575.md?page=2)
