# Button in position A take way A

**URL:** <https://discourse.nodered.org/t/button-in-position-a-take-way-a/56184>\
**Category:** General\
**Created:** [5 January 2022 23:38 UTC](https://discourse.nodered.org/t/button-in-position-a-take-way-a/56184 "2022-01-05T23:38:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![azertym](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/azertym/32/52108_2.png) [@azertym](https://discourse.nodered.org/u/azertym)\
**Post date:** [5 January 2022 23:38 UTC](https://discourse.nodered.org/t/button-in-position-a-take-way-a/56184/1 "2022-01-05T23:38:56Z")

</div>

Hi All,

In fist time i wish you a very happy New year !

I'm here because i've a question about node red.

I use a button with 2 positions : left position "short" and right position "long"

I made 2 Flow, 1 Flow with short Flow and and other with long Flow.

I don't know make this system. When the button is short position, take short way. And when the button is in long position go to the long way.

I tried to use Switch, or change but is not correct.

How do you do make this ?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [6 January 2022 00:28 UTC](https://discourse.nodered.org/t/button-in-position-a-take-way-a/56184/2 "2022-01-06T00:28:36Z")

</div>

Store the position of the switch in a flow variable (use a change node to set `flow.switch` to value of `msg.payload`)

Then use a switch node with 2 entries that check the value of `flow.switch`

If you are just learning node-red, I recommend watching this playlist: [Node-RED Essentials](https://www.youtube.com/playlist?list=PLyNBB9VCLmo1hyO-4fIZ08gqFcXBkHy-6). The videos are done by the developers of node-red. They're nice & short and to the point. You will understand a whole lot more in about 1 hour. A small investment for a lot of gain.

---

<div class="post-metadata">

**Author:** ![azertym](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/azertym/32/52108_2.png) [@azertym](https://discourse.nodered.org/u/azertym)\
**Post date:** [6 January 2022 14:36 UTC](https://discourse.nodered.org/t/button-in-position-a-take-way-a/56184/3 "2022-01-06T14:36:08Z")

</div>

Thanks a lot Steve-Mcl,

Now it's work.

---

<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 January 2022 14:36 UTC](https://discourse.nodered.org/t/button-in-position-a-take-way-a/56184/4 "2022-01-20T14:36:41Z")

</div>

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