# Including timestamp in a call service to Notify

**URL:** https://discourse.nodered.org/t/including-timestamp-in-a-call-service-to-notify/57865
**Category:** General
**Created:** [6 February 2022 11:07 UTC](https://discourse.nodered.org/t/including-timestamp-in-a-call-service-to-notify/57865 "2022-02-06T11:07:34Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![BerkshireBugsy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/berkshirebugsy/32/55921_2.png) [@BerkshireBugsy](https://discourse.nodered.org/u/BerkshireBugsy)
#### Post date: [6 February 2022 11:07 UTC](https://discourse.nodered.org/t/including-timestamp-in-a-call-service-to-notify/57865/1 "2022-02-06T11:07:35Z")

</div>

First post here - I hope I get this right!

I'm running Node Red v2.2.0 on Home Assistant and when certain events happen in NR I want to use the call service function to send a notification to my mobile. This bit I have working.

BUT 🙂

I want to timestamp the message being sent out by the notify call. From my googling I have found that it may be possible by calling a node red function ([see here](https://discourse.nodered.org/t/add-a-timestamp-to-function-node/22610)) but I don't yet understand how I can include the output of this function into the call service option.

Here (See attachment) is the detail of my call service section. Can I somehow include the date and time in the output to my mobile?

 ![Screenshot 2022-02-06 105444](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/1/a1ad8db38d9b6ee9367c37d630056a5cd68855d1.png)

---

<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: [6 February 2022 11:19 UTC](https://discourse.nodered.org/t/including-timestamp-in-a-call-service-to-notify/57865/2 "2022-02-06T11:19:08Z")

</div>

You can do that directly in the call service node with the JSONata expression

```auto
{"message": "GR lamp ON " & $moment().tz("Europe/London").format("DD-MM-yyyy HH:mm:ss")}

```

[edit] you can also add msg vaiables the same way  
eg.

```auto
{"message": "GR lamp ON " & $$.payload}

```

should add the contents of msg.payload.

---

<div class="post-metadata">

### Author: ![BerkshireBugsy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/berkshirebugsy/32/55921_2.png) [@BerkshireBugsy](https://discourse.nodered.org/u/BerkshireBugsy)
#### Post date: [6 February 2022 11:20 UTC](https://discourse.nodered.org/t/including-timestamp-in-a-call-service-to-notify/57865/3 "2022-02-06T11:20:11Z")

</div>

Wow ! Thank you! I'm off to play....sorry mean test!

Ta

---

<div class="post-metadata">

### Author: ![BerkshireBugsy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/berkshirebugsy/32/55921_2.png) [@BerkshireBugsy](https://discourse.nodered.org/u/BerkshireBugsy)
#### Post date: [6 February 2022 11:30 UTC](https://discourse.nodered.org/t/including-timestamp-in-a-call-service-to-notify/57865/4 "2022-02-06T11:30:41Z")

</div>

Thank you - it worked first time 🙂

---

<div class="post-metadata">

### Author: ![hdehaseleer](https://avatars.discourse-cdn.com/v4/letter/h/d6d6ee/32.png) [@hdehaseleer](https://discourse.nodered.org/u/hdehaseleer)
#### Post date: [6 February 2022 11:46 UTC](https://discourse.nodered.org/t/including-timestamp-in-a-call-service-to-notify/57865/5 "2022-02-06T11:46:00Z")

</div>

> [@E1cid](#):
>
> `{"message": "GR lamp ON " & $.payload}`

I can already send a normal text string by email.  
I have concatenated a string message in a function. And the debug screen shows a correct string  
Now I want to send the payload of the function by email

I don't find the correct syntax to send this message. This does not works  
{  
"title": "Temperaturen Herman",  
"message": "{{msg.payload}}"  
}

Nor this  
{  
"title": "Temperaturen Herman",  
"message": "Temperaturen zijn:", $$.payload  
}

---

<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: [20 February 2022 11:46 UTC](https://discourse.nodered.org/t/including-timestamp-in-a-call-service-to-notify/57865/6 "2022-02-20T11:46:14Z")

</div>

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