Concatenete text and payload

Hi i am a beginner in nodered, I would like to combine a text and a payload in a message to create an webos lgtv alert notification, i want to change "message":"Just Testing" with "message":"Just Testing & {{payload}}", node used is node-red-contrib-lgtv

msg.payload {"title":"Test Message","message":"Just Testing","isSysReq":true,"modal":true,"buttons":[{"label":"Dismiss"}]}
msg.topic ssap://system.notifications/createAlert

Thanks in advance and sorry if I wrote something wrong

You can apply the message items like payload and topic in a template node. This would entail putting these text values to the message parts into the same message then input to the template.

Thanks for the answer, I do not know if I understand well, I tried to create a template something is not right

[{"id":"df70b8da1fbe02c2","type":"lgtv-request","z":"2d0c3dfe7ecb14a9","tv":"d4a4b73e2368cd49","name":"LGTV","x":650,"y":200,"wires":[["ce46c453b99940a3"]]},{"id":"8f2a818f4e783ce0","type":"template","z":"2d0c3dfe7ecb14a9","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"\"topic\": \"ssap://system.notifications/createAlert\",\n\"payload\": { \"title\": \"Test Message\", \"message\": Test {{payload}} , \"isSysReq\": true, \"modal\": true, \"buttons\": [{ \"label\": \"Dismiss\" }] }","output":"str","x":420,"y":200,"wires":[["df70b8da1fbe02c2","ce46c453b99940a3"]]},{"id":"ce46c453b99940a3","type":"debug","z":"2d0c3dfe7ecb14a9","name":"debug 15","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":840,"y":140,"wires":[]},{"id":"746d6eba5c809a49","type":"inject","z":"2d0c3dfe7ecb14a9","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":240,"y":200,"wires":[["8f2a818f4e783ce0"]]},{"id":"d4a4b73e2368cd49","type":"lgtv-config","host":"192.168.1.100"}]

can you help me ?

so I understand that it is not possible

I am sure it is possible!

I don't really understand this:

i want to change "message":"Just Testing" with "message":"Just Testing & {{payload}}",
msg.payload {"title":"Test Message","message":"Just Testing","isSysReq":true,"modal":true,"buttons":[{"label":"Dismiss"}]}

What is in msg.payload before you do the join?
How do you want it to look after the join?

  1. msg.payload = {"title":"Test Message","message":"Just Testing","isSysReq":true,"modal":true,"buttons":[{"label":"Dismiss"}]}
  2. I want to enter the value of a temperature sensor in this message - "message":"Just Testing"
    2.1 the payload value is 22
  3. the output will be "message":"Just Testing 22 Celsius degrees"

I managed to solve the problem in the end, instead of the function I used the switch node, I hope to help someone else

[{"id":"d17d22fdeb83595b","type":"change","z":"c14ed17f.70b7a","name":"payload","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"title\":\"Temperatuta interior Marghita\",\"message\":\"Acum sunt \"& msg.payload & \" °C\",\"isSysReq\":true,\"modal\":true,\"buttons\":[{\"label\":\"Multumesc\"}]}","tot":"jsonata"},{"t":"set","p":"topic","pt":"msg","to":"ssap://system.notifications/createAlert","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":80,"wires":[["d7eb1bd18592a76a"]]}]

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