Unique random numbers


Hi everyone.

I can’t find this topic anywhere else, so I hope someone can help me.

I want to generate six UNIQUE random numbers between let’s say 1 and 100.

Using the ‘random integer from 1 to100’ works fine for one number. But when you generate six, there are sometimes duplicates and this shouldn’t happen.

Any idea on how to do this without a PhD in mathematics?


Just create a list that holds generated random number. If the number exists, means you have to get another random

How to generate unique id number

My procedure creates a list of random numbers, with these options

How many numbers
Repeat or unique numbers
Sorted or unsorted
Sort order ascending or descending

GenerateRandomNumbers_function.aia (15.0 KB)

How to create random number without repeating same number?
[Free] QuizMaker Extension

Thank you guys. Your helpfulness if appreciated a lot!


I have managed to use a list to generate six random numbers.

My problem is the results go into an unformatted local variable. I can get it displayed in a text box in this form (1 2 3 4 5 6)

How do I get it out of there so I can format it and place each individual number in its own text box?


you might want to learn
How to work with Lists by Saj
How to work with Lists and Lists of lists (pdf) by appinventor.org


Here is a alternative method:

On initialization, create a list that includes 1 to 100
Next select random item from list and then remove from list

Above ensures that every time you get unique number


That’s exactly what my procedure (above) does when you set the noRepeat parameter to TRUE.


Hay John this was quite a good idea, it was useful for me, you said it right. Boys but what if we are gonna make a program to run and to show the number that are representing the personality of the person based on the numbers you choose, and then you have take all the data from https://www.sunsigns.org/angel-numbers/ to make a database and to put it in the program. The program is connected with database and it should run. What do you think?


Yes It ideal number to connect database