Oh you are right, it is a forEach not a for in. I was concentrating on what was inside instead of what was doing the iteration.
So yes, you are correct, it is the fact that msg.payload is being overwritten that is the problem.
1 Like