Insert payload into message

Dear Nodes,

Can somebody assist me, in how to create a message, where a payload value in is inserted.
Goal is to create a message for Telegram, where the name of a specifik smoke alert is inserted into
a sentence, wich will be send to Telegram

Kind regards,

in a function node...

msg.payload = `There is a fire in ${msg.payload}`
return msg


msg.payload = {
  "original_payload": msg.payload,
  "message":  "There is a fire"
return msg


const origPayload = msg.payload
msg.payload = {}
msg.payload.message = "there is a fire" = origPayload
return msg

If you want more relevant advice, please provide more detail of how you want the msg to look and what it will contain. Provide details of what the input looks like and when it should be considered a "smoke alert"

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