# Creating Lists of Random Things

**URL:** <https://forum.bubble.io/t/creating-lists-of-random-things/49618>\
**Category:** Need help\
**Created:** [February 15, 2019, 10:49am UTC](https://forum.bubble.io/t/creating-lists-of-random-things/49618 "2019-02-15T10:49:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sales2](https://avatars.discourse-cdn.com/v4/letter/s/c67d28/32.png) [@sales2](https://forum.bubble.io/u/sales2)\
**Post date:** [February 15, 2019, 10:49am UTC](https://forum.bubble.io/t/creating-lists-of-random-things/49618/1 "2019-02-15T10:49:16Z")

</div>

Trying to create a list of random numbers.  
Wanting to create it from an existing list of numbers.  
So, want I want to acheive is:  
number source\_ids = (1,2,3,4,5,6,7,8,9,10)  
number random\_ids = ( 5,7,2,10,6) for example

I’ve set the above as state variables, then click a button, to invoke a workflow to:

set\_state of random\_ids = random\_ids:plusitem source\_ids:random\_item

NOTE: I’ve omitted ‘this\_button’s’ from above specification of state variables.

This works, so each time I press the button, random\_ids shows another random number.  
5  
5,7  
5,7,2

It stops working after 3 goes.  
Also, the random numbers are not so random. They are the same everytime it runs.  
It actually returns (4,8,12) each time.

I’ve tried the same formula (using :plusitem and :random\_item) on state variables, fields (with type list of numbers) and new Things with fields of type number (and inserting multiple records). All result in the same behaviour.

Any thoughts appreciated.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/bubble/original/3X/2/8/2847faa74692c2ffa5d939d3dc3724cdd060d247.png) [@system](https://forum.bubble.io/u/system)\
**Post date:** [April 26, 2019, 11:02am UTC](https://forum.bubble.io/t/creating-lists-of-random-things/49618/2 "2019-04-26T11:02:05Z")

</div>

Closed on April 26, 2019, 11:02am UTC

This topic was automatically closed after 70 days. New replies are no longer allowed.
