# Random Number Generator-Non repeat

**URL:** https://community.thunkable.com/t/random-number-generator-non-repeat/2740628
**Category:** Questions about Thunkable X
**Created:** [December 6, 2023, 3:10am UTC](https://community.thunkable.com/t/random-number-generator-non-repeat/2740628 "2023-12-06T03:10:45Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![nascentaa0obfo](https://avatars.discourse-cdn.com/v4/letter/n/f08c70/32.png) [@nascentaa0obfo](https://community.thunkable.com/u/nascentaa0obfo)
#### Post date: [December 6, 2023, 3:10am UTC](https://community.thunkable.com/t/random-number-generator-non-repeat/2740628/1 "2023-12-06T03:10:45Z")

</div>

I am trying to make a random number generator which starts from 100 and for each time data is added it adds 1 to the number. For example: 100,101,102,103. I am also trying to save it in a database (google sheets).

---

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [December 6, 2023, 5:44am UTC](https://community.thunkable.com/t/random-number-generator-non-repeat/2740628/2 "2023-12-06T05:44:49Z")

</div>

What part of it is random? Can you give a couple examples of how this would work with actual values?

What is the purpose of the random numbers?

Have you searched the forums for these topics? There are examples of how to create random non-repeating numbers.

---

<div class="post-metadata">

### Author: ![nascentaa0obfo](https://avatars.discourse-cdn.com/v4/letter/n/f08c70/32.png) [@nascentaa0obfo](https://community.thunkable.com/u/nascentaa0obfo)
#### Post date: [December 7, 2023, 1:13am UTC](https://community.thunkable.com/t/random-number-generator-non-repeat/2740628/3 "2023-12-07T01:13:13Z")

</div>

For question 1 “What part of it is random” - I mean by random as in order 100, 101, 102,103. It should not repeat whenever I open and close the app.

For example: When I open the app and enter data into this, lets say it starts of from 100.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/7/e/7e11f23ed89aa4462bf33cfc47c75f3880a31dc6.png)

When I open the app again I want the data to be like this  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/e/feb74fbc5acba5091f82eda43e64633df9c09046.png)

However my current code makes the bar reset whenever I open the app. So lets say i started and i added 2 students. Then it goes like this  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/7/1/7186e6485027b207476b849842bd11c06b449186.png)

I am making these for a student id fuctionality

I have searched the forum for these topics, but they all do notsave their data in a spreadsheet.

---

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [December 7, 2023, 4:05am UTC](https://community.thunkable.com/t/random-number-generator-non-repeat/2740628/4 "2023-12-07T04:05:41Z")

</div>

Numbers in order like 100, 101, and 102 are not random. They are _sequential_. So I think maybe you are using the wrong word to describe this.

To save a value even when you close the app, you need to use a _stored_ variable. You can view the tutorial here: [https://docs.thunkable.com/blocks/blocks/variables#stored-variables](https://docs.thunkable.com/blocks/blocks/variables#stored-variables).

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/f/0f59f292712368bce16ff80133ae10de8a6f27e8.png) [@system](https://community.thunkable.com/u/system)
#### Post date: [March 6, 2024, 4:06am UTC](https://community.thunkable.com/t/random-number-generator-non-repeat/2740628/5 "2024-03-06T04:06:15Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
