# Generate random code

**URL:** https://community.thunkable.com/t/generate-random-code/428208
**Category:** Questions about Thunkable X
**Created:** [January 26, 2020, 1:14pm UTC](https://community.thunkable.com/t/generate-random-code/428208 "2020-01-26T13:14:34Z")
**Posts on this page:** 18
**Page:** 2

<div class="post-metadata">

### Author: ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)
#### Post date: [January 27, 2020, 5:30pm UTC](https://community.thunkable.com/t/generate-random-code/428208/21 "2020-01-27T17:30:53Z")

</div>

Can you share your app with me? I will look at it and get back with you

---

<div class="post-metadata">

### Author: ![Fernando\_Matos](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/fernando_matos/32/30641_2.png) [@Fernando\_Matos](https://community.thunkable.com/u/Fernando_Matos)
#### Post date: [January 27, 2020, 8:18pm UTC](https://community.thunkable.com/t/generate-random-code/428208/22 "2020-01-27T20:18:29Z")

</div>

when I download the code it doesn’t generate at all. i will try the api i found. if it works i share the api and the blocks. thankyou

---

<div class="post-metadata">

### Author: ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)
#### Post date: [January 27, 2020, 8:37pm UTC](https://community.thunkable.com/t/generate-random-code/428208/23 "2020-01-27T20:37:36Z")

</div>

Sorry to hear that it didn’t work! I was playing with the project. Hopefully this one works, I just double checked before sharing. Id love to see what you come up with also!

[https://x.thunkable.com/copy/9887e4d2e1f2509ed65a6e7d7623e626](https://x.thunkable.com/copy/9887e4d2e1f2509ed65a6e7d7623e626)

---

<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: [January 27, 2020, 9:01pm UTC](https://community.thunkable.com/t/generate-random-code/428208/24 "2020-01-27T21:01:49Z")

</div>

@jared Your project didn’t preview properly on my device:

 ![IMG_0086.PNG](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/7/976cf7f53e4295d0695b72f50a00aadfb5c0fe5f.jpeg)

---

<div class="post-metadata">

### Author: ![eoinparkinson](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/eoinparkinson/32/143769_2.png) [@eoinparkinson](https://community.thunkable.com/u/eoinparkinson)
#### Post date: [January 27, 2020, 9:53pm UTC](https://community.thunkable.com/t/generate-random-code/428208/25 "2020-01-27T21:53:04Z")

</div>

> [@Fernando\_Matos](#):
>
> ![Sem Título](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/4/440928119503c25fbf6a8c46f6e60ac032f6beb1.png)

This could be further randomised more fairly (i.e. Not follow the pattern that you have created) by first making the app randomly pick between which list the next character will be picked from, then picking from that list. This would make it more fair and means you can have numbers and letters beside each other 🙂

Your idea is fabulous nonetheless.

---

<div class="post-metadata">

### Author: ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)
#### Post date: [January 27, 2020, 10:15pm UTC](https://community.thunkable.com/t/generate-random-code/428208/26 "2020-01-27T22:15:54Z")

</div>

Weird. Here is a fresh share link. I just tried it to make sure it works.

[https://x.thunkable.com/copy/00b74e30aaf89a9d22493f2dffa37eb7](https://x.thunkable.com/copy/00b74e30aaf89a9d22493f2dffa37eb7)

The random button should initialize as disabled. If not, there’s a problem.

---

<div class="post-metadata">

### Author: ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)
#### Post date: [January 27, 2020, 10:22pm UTC](https://community.thunkable.com/t/generate-random-code/428208/27 "2020-01-27T22:22:49Z")

</div>

Thank you!! You’re right though. Randomizing the type and placement of each character would be the ideal randomization. The code I posted still creates random strings but there is a pattern to the randomness…

---

<div class="post-metadata">

### Author: ![eoinparkinson](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/eoinparkinson/32/143769_2.png) [@eoinparkinson](https://community.thunkable.com/u/eoinparkinson)
#### Post date: [January 28, 2020, 12:25am UTC](https://community.thunkable.com/t/generate-random-code/428208/28 "2020-01-28T00:25:38Z")

</div>

I’m sure there are dozens of ways to do it! When you are done your app I’d love to hear about it!

---

<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: [January 28, 2020, 1:27am UTC](https://community.thunkable.com/t/generate-random-code/428208/29 "2020-01-28T01:27:57Z")

</div>

I was thinking the same. I started building it that way but didn’t have time to finish it yet.

---

<div class="post-metadata">

### Author: ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)
#### Post date: [January 28, 2020, 4:20am UTC](https://community.thunkable.com/t/generate-random-code/428208/30 "2020-01-28T04:20:06Z")

</div>

@tatiang @eoinparkinson

this is 1 step further

 ![Screen Shot 2020-01-27 at 11.08.14 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/7/8793e308e74241c8b8c0fcbd5a0bdc2fd88535c2.png)

---

<div class="post-metadata">

### Author: ![ozel1978](https://avatars.discourse-cdn.com/v4/letter/o/3ec8ea/32.png) [@ozel1978](https://community.thunkable.com/u/ozel1978)
#### Post date: [August 23, 2020, 4:10pm UTC](https://community.thunkable.com/t/generate-random-code/428208/31 "2020-08-23T16:10:32Z")

</div>

Hi Jared,

how to created number with standard formation? for example 100 to 200. if user click it will get 100 then 101 until 200. once it finish it will repeat from beginning. i dont want random number.

---

<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: [August 23, 2020, 8:54pm UTC](https://community.thunkable.com/t/generate-random-code/428208/32 "2020-08-23T20:54:38Z")

</div>

That should be pretty straight-forward.

Initialize variable to 100.  
On click  
–\>If variable = 200  
–\>--\>Change variable to 100  
–\>Else  
–\>--\>Change variable by 1

---

<div class="post-metadata">

### Author: ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)
#### Post date: [August 23, 2020, 9:12pm UTC](https://community.thunkable.com/t/generate-random-code/428208/33 "2020-08-23T21:12:57Z")

</div>

@ozel1978 ^^^^^

Thanks @tatiang

---

<div class="post-metadata">

### Author: ![ozel1978](https://avatars.discourse-cdn.com/v4/letter/o/3ec8ea/32.png) [@ozel1978](https://community.thunkable.com/u/ozel1978)
#### Post date: [August 27, 2020, 3:51pm UTC](https://community.thunkable.com/t/generate-random-code/428208/34 "2020-08-27T15:51:19Z")

</div>

thank you guys.

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

---

<div class="post-metadata">

### Author: ![ozel1978](https://avatars.discourse-cdn.com/v4/letter/o/3ec8ea/32.png) [@ozel1978](https://community.thunkable.com/u/ozel1978)
#### Post date: [August 30, 2020, 5:00pm UTC](https://community.thunkable.com/t/generate-random-code/428208/35 "2020-08-30T17:00:30Z")

</div>

jared,  
i found it new session it will duplicate same number. so how to avoid that?

---

<div class="post-metadata">

### Author: ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)
#### Post date: [August 30, 2020, 7:53pm UTC](https://community.thunkable.com/t/generate-random-code/428208/36 "2020-08-30T19:53:50Z")

</div>

Probably gonna wanna use a cloud variable or stored variable.

---

<div class="post-metadata">

### Author: ![Hayder](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/hayder/32/153829_2.png) [@Hayder](https://community.thunkable.com/u/Hayder)
#### Post date: [March 29, 2023, 4:12am UTC](https://community.thunkable.com/t/generate-random-code/428208/37 "2023-03-29T04:12:43Z")

</div>

> [@Fernando\_Matos](#):
>
> hello everyone I would like to create a random id with numbers and letters with a number of different characters! does anyone know how?

Hello  
Try this. You can even add more letters or codes.

 ![٢٠٢٣٠٣٢٩_٠٧١١٠٦](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/1/01af0240aad04e5cd4c65c94dd383d4a857b2f77.jpeg)

---

<div class="post-metadata">

### Author: ![matt\_conroy](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/matt_conroy/32/150843_2.png) [@matt\_conroy](https://community.thunkable.com/u/matt_conroy)
#### Post date: [March 29, 2023, 5:34pm UTC](https://community.thunkable.com/t/generate-random-code/428208/38 "2023-03-29T17:34:31Z")

</div>



[Previous page](https://community.thunkable.com/t/generate-random-code/428208.md?page=1)
