# Send payload with notify

**URL:** <https://discourse.nodered.org/t/send-payload-with-notify/73523>\
**Category:** General\
**Created:** [11 January 2023 10:17 UTC](https://discourse.nodered.org/t/send-payload-with-notify/73523 "2023-01-11T10:17:06Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![kroonp](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kroonp/32/68249_2.png) [@kroonp](https://discourse.nodered.org/u/kroonp)\
**Post date:** [11 January 2023 10:17 UTC](https://discourse.nodered.org/t/send-payload-with-notify/73523/1 "2023-01-11T10:17:06Z")

</div>

I have a inject node with the numeric value 40.  
In notify I want to send the payload from the inject node.  
'''  
{   
"message":"test"+ {{msg.payload}},"title":"10.Test"  
}  
'''  
Can you help me with the correct syntax.  
Thankx in advance  
Peter

---

<div class="post-metadata">

**Author:** ![GogoVega](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gogovega/32/71313_2.png) [@GogoVega](https://discourse.nodered.org/u/GogoVega)\
**Post date:** [11 January 2023 10:58 UTC](https://discourse.nodered.org/t/send-payload-with-notify/73523/2 "2023-01-11T10:58:13Z")

</div>

Please, could you be more specific about the structure of the message.

---

<div class="post-metadata">

**Author:** ![GogoVega](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gogovega/32/71313_2.png) [@GogoVega](https://discourse.nodered.org/u/GogoVega)\
**Post date:** [11 January 2023 11:14 UTC](https://discourse.nodered.org/t/send-payload-with-notify/73523/3 "2023-01-11T11:14:21Z")

</div>

`msg.topic` is your title and `msg.payload` is your message:

```plaintext
msg = {
    payload: `test ${msg.payload}`,
    topic: "10.Test"
};

```

---

<div class="post-metadata">

**Author:** ![kroonp](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kroonp/32/68249_2.png) [@kroonp](https://discourse.nodered.org/u/kroonp)\
**Post date:** [11 January 2023 12:33 UTC](https://discourse.nodered.org/t/send-payload-with-notify/73523/4 "2023-01-11T12:33:38Z")

</div>

Unfortunately I get an error with your proposal.

---

<div class="post-metadata">

**Author:** ![GogoVega](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gogovega/32/71313_2.png) [@GogoVega](https://discourse.nodered.org/u/GogoVega)\
**Post date:** [11 January 2023 12:37 UTC](https://discourse.nodered.org/t/send-payload-with-notify/73523/5 "2023-01-11T12:37:37Z")

</div>

What error and can you show your nodes?

---

<div class="post-metadata">

**Author:** ![kroonp](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kroonp/32/68249_2.png) [@kroonp](https://discourse.nodered.org/u/kroonp)\
**Post date:** [11 January 2023 12:56 UTC](https://discourse.nodered.org/t/send-payload-with-notify/73523/6 "2023-01-11T12:56:40Z")

</div>

Call-service error. required key not provided @ data['message']

---

<div class="post-metadata">

**Author:** ![GogoVega](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gogovega/32/71313_2.png) [@GogoVega](https://discourse.nodered.org/u/GogoVega)\
**Post date:** [11 January 2023 13:21 UTC](https://discourse.nodered.org/t/send-payload-with-notify/73523/7 "2023-01-11T13:21:33Z")

</div>

Could you export the nodes in question (ctrl + E), is it the "node-red-node-notify"?  
Use the following syntax to insert your nodes:  
```json  
\<FLOW\_HERE\>  
```

---

<div class="post-metadata">

**Author:** ![kroonp](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kroonp/32/68249_2.png) [@kroonp](https://discourse.nodered.org/u/kroonp)\
**Post date:** [11 January 2023 13:41 UTC](https://discourse.nodered.org/t/send-payload-with-notify/73523/8 "2023-01-11T13:41:20Z")

</div>

```auto
json
[{"id":"415392015f043e85","type":"api-call-service","z":"50417ac5b5a5a836","name":"Test notify","server":"3c6b2d2d.b63e72","version":5,"debugenabled":false,"domain":"notify","service":"telegram","areaId":[],"deviceId":[],"entityId":[],"data":"msg = {\t payload: `test ${msg.payload}`,\t topic: \"10.Test\"\t}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":870,"y":4750,"wires":[[]]},{"id":"529fa993b3bd5cda","type":"inject","z":"50417ac5b5a5a836","name":"40","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"test","payload":"40","payloadType":"num","x":680,"y":4750,"wires":[["415392015f043e85"]]},{"id":"3c6b2d2d.b63e72","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30,"areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true}]

```

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [11 January 2023 13:48 UTC](https://discourse.nodered.org/t/send-payload-with-notify/73523/9 "2023-01-11T13:48:27Z")

</div>

> [@kroonp](#):
>
> {  
> "message":"test"+ {{msg.payload}},"title":"10.Test"  
> }

I don't use HA but to use mustache it would be something like

```auto
{
"message": "test{{msg.payload}}", 
"title": "10.Test"
}

```

Or select JSONata and use something like

```auto
{
"message": "test" & $$.payload, 
"title": "10.Test"
}

```

---

<div class="post-metadata">

**Author:** ![kroonp](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kroonp/32/68249_2.png) [@kroonp](https://discourse.nodered.org/u/kroonp)\
**Post date:** [11 January 2023 14:03 UTC](https://discourse.nodered.org/t/send-payload-with-notify/73523/10 "2023-01-11T14:03:26Z")

</div>

The last option is working.  
Thanks very much for your help!!  
Peter

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [12 March 2023 14:04 UTC](https://discourse.nodered.org/t/send-payload-with-notify/73523/11 "2023-03-12T14:04:03Z")

</div>

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