# Function If Node get not triggert | "21:30" =="21:30" | msg.mytime == msg.payload.topic1

**URL:** <https://discourse.nodered.org/t/function-if-node-get-not-triggert-21-30-21-30-msg-mytime-msg-payload-topic1/13379>\
**Category:** General\
**Created:** [16 July 2019 19:59 UTC](https://discourse.nodered.org/t/function-if-node-get-not-triggert-21-30-21-30-msg-mytime-msg-payload-topic1/13379 "2019-07-16T19:59:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kiwi\_gamer01](https://avatars.discourse-cdn.com/v4/letter/k/a587f6/32.png) [@Kiwi\_gamer01](https://discourse.nodered.org/u/Kiwi_gamer01)\
**Post date:** [16 July 2019 19:59 UTC](https://discourse.nodered.org/t/function-if-node-get-not-triggert-21-30-21-30-msg-mytime-msg-payload-topic1/13379/1 "2019-07-16T19:59:40Z")

</div>

Why get the function node not triggerd?

 ![am%20pm](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/d/d40152579eca3fcc122bc6fe8b8e546ef8bfe2a5.png)

Here is the Flow:

```auto
[{"id":"d64b87be.5f7ca8","type":"function","z":"a7004483.d00c88","name":"am pm","func":"if (msg.mytime == msg.payload.topic1) {\n msg.payload = \"Good morning\";\n} \nelse if (msg.mytime == msg.payload.topic2){\n msg.payload = \"good evening\";\n}\n","outputs":1,"noerr":0,"x":578.6775894165039,"y":247.25756072998047,"wires":[["153b812b.55fa3f"]]}]

```

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [16 July 2019 20:24 UTC](https://discourse.nodered.org/t/function-if-node-get-not-triggert-21-30-21-30-msg-mytime-msg-payload-topic1/13379/2 "2019-07-16T20:24:02Z")

</div>

Are they in different messages?  
If so a function has no memory of past messages  
you need to look to join the messages together  
or use a context value. Some of the examples in the cookbook might help. [http://cookbook.nodered.org](http://cookbook.nodered.org)
