Trying to refer to parts in an array without undefined error?

Hello folks,

Coming across a problem I can`t get around,

I thought to address the point in a payload it would be msg.payload.data[ "Number of which you want"]

But it doesnt work ? If I was wanting to address each value in the list seperately what should I do ?

Thank you

try reversing the order... of those two lines...
the first one blatts msg.payload... then the second tries to read msg.payload as it was... but it is no longer there.

On line 5 you set msg.payload to an integer, which overwrites msg.payload.data

Also the debug you show says that msg.payload is an array, msg.payload.data does not exist.

I note that the two error messages in the debug do not come from the same function node, that may or may not be relevant.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.