# Trigger on condition

**URL:** <https://discourse.nodered.org/t/trigger-on-condition/78985>\
**Category:** General\
**Created:** [6 June 2023 09:40 UTC](https://discourse.nodered.org/t/trigger-on-condition/78985 "2023-06-06T09:40:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![SoAu](https://avatars.discourse-cdn.com/v4/letter/s/8e7dd6/32.png) [@SoAu](https://discourse.nodered.org/u/SoAu)\
**Post date:** [6 June 2023 09:40 UTC](https://discourse.nodered.org/t/trigger-on-condition/78985/1 "2023-06-06T09:40:37Z")

</div>

Hi Guys,  
I have function node returning msg, either 2 or 5.  
I just need to trigger some function if msg=2 not on any other msg.

Thanks !!

---

<div class="post-metadata">

**Author:** ![ghayne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ghayne/32/39_2.png) [@ghayne](https://discourse.nodered.org/u/ghayne)\
**Post date:** [6 June 2023 10:03 UTC](https://discourse.nodered.org/t/trigger-on-condition/78985/2 "2023-06-06T10:03:26Z")

</div>

Welcome to the forum!

The switch node will do what you want.

---

<div class="post-metadata">

**Author:** ![SoAu](https://avatars.discourse-cdn.com/v4/letter/s/8e7dd6/32.png) [@SoAu](https://discourse.nodered.org/u/SoAu)\
**Post date:** [6 June 2023 10:27 UTC](https://discourse.nodered.org/t/trigger-on-condition/78985/3 "2023-06-06T10:27:25Z")

</div>

Thanks for reply, Yes got it.

---

<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 June 2023 10:28 UTC](https://discourse.nodered.org/t/trigger-on-condition/78985/4 "2023-06-20T10:28:21Z")

</div>

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