Change the value of payload in a function node

For various reasons, I'm using a function node to change the payload. My incoming payload is a string. How do I incorporate that into the following function?

msg.payload = 
{
    data: 
    {
        "message":" incoming_payload ",
        "data":
            {
            "priority":"high",
            "importance":"high",
            }
    }
}

return msg;

msg.payload = 
{
    data: 
    {
        "message": msg.payload,
        "data":
            {
            "priority":"high",
            "importance":"high",
            }
    }
}

return msg;

Assuming the incoming payload is msg.payload

1 Like

Thanks. I really tried to find the answer before asking, but that looks so obvious it's embarrassing.

Cheers, Richard

1 Like

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