Set msg.payload to msg.payload.xyz

Hello all :wave:,

I am here asking is there a JSON code where i can input it in my function node and achieve this function, for example I am trying to set my msg.payload to msg.payload.xyz.

Would appreciate it!
image

In a function node that would be

msg.payload = msg.payload.xyz;
return msg;

@E1cid Hi, thanks for the reply,

sorry, it was my mistake, but I am trying to change msg.payload to msg.payload.xyz instead of giving msg.payload the value of msg.payload.xyz.

Do you mean that you want msg.payload.xyz to have the value that was in msg.payload? So the equivalent of a Change mode set to Move msg.payload To msg.payload.xyz? If so then you can use
msg.payload = {xyz: msg.payload}

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