Change msg.payload to msg.payload.ANYNAME


I'm new on node red and well, messages are quite hard for me to understand... I tried but I can't get my issue resolved...

HOW can I pass a number within msg.payload on to a different message e.g. Could not do it with set to .....

I am trying to send data to a google form, that will send it to a google spreadsheet. To do so, I need to send a message that contains a number (measurement value) with the name


Welcome to the forum. Have a look at the change node!

I had already tried that within the change node without success...

Look thru this

So 1st step is to save the old msg.payload somewhere
Then delete it
Then set to the old payload
Then to tidy up - (but not necessary) delete our temp copy of the payload

The basic issue is that msg.payload can be swapped/set to numbers/strings at will but you can't then change to using it as an object to hold other objects/values.

It has to be deleted and then re-created as an object

Prob not strickly using the correct terms here but this is the way I got my head around the issue :slight_smile:

or use the move option instead.... which does the save/delete/replace for you.

1 Like

That was going to be lesson 2 once the OP has got their head around the concept :slight_smile:

Thanks a lot!! this solved my issue! :smiley: :smiley:
Also tried it with move but did not work out straight away. Will try it again later but as for now, I leave it like that - never change a working system or so :smiley:

It should work and its a lot more compact

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