Instead of using the slot IID to track its 'ID', use an instance variable on the slot that is set in the editor beforehand that is used to match the co-ord from the array, then only put items in the array not numbers, for testing filling with 1,2,3 can be confusing so use 'sword' 'potion' or whatever.
So in bag 1 the slot.ID for the 3 slots can be 1 2 and 3, and they read from x=1, 2 and 3 in the array. To 'fill' or assign an item to the slot you can use a string variable on the slot like itemname and it reads from the array indexof(slot.ID) which should be an item.