Plug whatever is the value in an empty slot in your array (I assume you use 0) into the "indexof" expression of the array object like so:
This expression will return the index at which the first X axis element matching the criteria is. Or -1 if an empty slot is not found. So in your case you will get the number of the first empty slot, in which you can put an item. Or if the result is -1 you can do some kind of "inventory is full" message.