Set Array Element returning Invalid

One thing to point out in your logic is when your array is full and have no available space. In this case, you will execute the Completed node, from the ForEachLoopWithBreak. If your variable “EmptySlot” is set to zero as default value, you would return the empty slot value of zero (first index of your array), and your array would be overwritten in the wrong slot accidentally.

Consider setting the default of your EmptySlot variable in a symbolic value, such as “-1”, and after calling this method, check the returned value: if >=0, then proceed; else, the array is full.