You'll probably need to use an array for this and I've created a very basic example here which does the following when you press 1 :
- Generates random item list
- Assigns the item to a slot linked with slot ID and the array position
In short the way I make an inventory is to link the ID with the exact co-ord in the array, so slot with ID 1 has item 1,0 in the array, slot with ID 2 has item 2,0 in the array. You can then manipulate and move the data around however you want. Your generation of random items will probably be more complex than "choose" between items, that was just for this example, you could probably make use of number ranges that define item rarity and then item type.
https://www.dropbox.com/s/6t6mm49g4a4pe ... .capx?dl=0