# Multistate switch - no output topic

**URL:** <https://discourse.nodered.org/t/multistate-switch-no-output-topic/52145>\
**Category:** Dashboard\
**Created:** [12 October 2021 20:20 UTC](https://discourse.nodered.org/t/multistate-switch-no-output-topic/52145 "2021-10-12T20:20:57Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [12 October 2021 20:20 UTC](https://discourse.nodered.org/t/multistate-switch-no-output-topic/52145/1 "2021-10-12T20:20:57Z")

</div>

Just noticed that the `ui-multistate-switch` output does not enable users to specify an output topic.  
Most of the dashboard nodes do have this feature, and it would be a useful addition, and help simplify dashboard flows.

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [12 October 2021 20:56 UTC](https://discourse.nodered.org/t/multistate-switch-no-output-topic/52145/2 "2021-10-12T20:56:18Z")

</div>

Hi Paul,

Indeed that makes sense.  
But there are two pratical issues in our config screen:

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/c/cce200bcf568e024373fcd46c10bf6dafd703495.png)

1. The editableList will become quite full, when we add a fourth _"Topic"_ column. And I would like to keep all the settings on a single row.

2. The second column has header label _"Value"_, which will be mapped by default to the payload (see orange link). When we would have called - at the time being - that column instead _"Payload"_, then imho it would look more natural if we had a _"Topic"_ column next to it. Although perhaps that doesn't matter...

Let's call the Node-RED interior designer @hotNipi, for professional styling advise 😉

Bart

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [12 October 2021 21:06 UTC](https://discourse.nodered.org/t/multistate-switch-no-output-topic/52145/3 "2021-10-12T21:06:31Z")

</div>

> [@BartButenaers](#):
>
> that column instead _"Payload"_ , then imho it would look more natural if we had a _"Topic"_ column next to it

Yes, that is what I thought, and would fulfil most configurations IMO.

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [12 October 2021 21:23 UTC](https://discourse.nodered.org/t/multistate-switch-no-output-topic/52145/4 "2021-10-12T21:23:24Z")

</div>

> [@BartButenaers](#):
>
> When we would have called - at the time being - that column instead _"Payload"_ , then imho it would look more natural if we had a _"Topic"_ column next to it.

Of course we could do something similar to like we did in the SVG node.  
Which means showing the State Field as column header:

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/7/e752603a23e67d346a85636d188eb88fa9c04d6b.png)

Then the editableList column headers are message field names, so you see immediately which value will be send in which field...

And when the user changes the State Field, then the column header will be adapted automatically to the same value.

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [12 October 2021 21:33 UTC](https://discourse.nodered.org/t/multistate-switch-no-output-topic/52145/5 "2021-10-12T21:33:25Z")

</div>

That would give the biggest range of user options, but using the same topic for all switch options would be simpler to implement, and meet most requirements.  
But whichever, you and @hotnipi decide... 👍

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [12 October 2021 21:46 UTC](https://discourse.nodered.org/t/multistate-switch-no-output-topic/52145/6 "2021-10-12T21:46:25Z")

</div>

> [@Paul-Reed](#):
>
> using the same topic for all switch options would be simpler to implement, and meet most requirements.

For me that is ok...

---

<div class="post-metadata">

**Author:** ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)\
**Post date:** [13 October 2021 05:18 UTC](https://discourse.nodered.org/t/multistate-switch-no-output-topic/52145/7 "2021-10-13T05:18:11Z")

</div>

I think the topic should be common.

---

<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 November 2021 05:18 UTC](https://discourse.nodered.org/t/multistate-switch-no-output-topic/52145/8 "2021-11-12T05:18:16Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [15 November 2021 18:49 UTC](https://discourse.nodered.org/t/multistate-switch-no-output-topic/52145/9 "2021-11-15T18:49:34Z")

</div>



---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [15 November 2021 19:17 UTC](https://discourse.nodered.org/t/multistate-switch-no-output-topic/52145/10 "2021-11-15T19:17:51Z")

</div>

Mister Paul,

I see that the other nodes do it like this:

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/a/da1e072d10002211e62ab2adc5a851b29767db8a.png)

Is that really required? Or is a simple input text box enough: when filled in, then use that value. Otherwise we leave the original msg.topic unchanged...

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [15 November 2021 19:20 UTC](https://discourse.nodered.org/t/multistate-switch-no-output-topic/52145/11 "2021-11-15T19:20:29Z")

</div>

> [@BartButenaers](#):
>
> Is that really required?

I would say no.  
IMO you could keep it simple.

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [15 November 2021 19:52 UTC](https://discourse.nodered.org/t/multistate-switch-no-output-topic/52145/12 "2021-11-15T19:52:55Z")

</div>

Hi Paul,  
Would be nice if you could test it (from Github...). The 'topic' field is at the bottom of the config screen...

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [15 November 2021 20:27 UTC](https://discourse.nodered.org/t/multistate-switch-no-output-topic/52145/13 "2021-11-15T20:27:29Z")

</div>

> [@BartButenaers](#):
>
> Would be nice if you could test it (from Github...).

Works great here.  
The only change that I'd make is to change the topic label from `Topic` to `Output Topic` (or `Topic Out` (if you are short of space), to avoid any confusion.

![topic](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/a/7a574827f11837170f41aaff2972c8cd34273caf.jpeg)

Thanks, I can delete the change nodes now 😀

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [15 November 2021 20:58 UTC](https://discourse.nodered.org/t/multistate-switch-no-output-topic/52145/14 "2021-11-15T20:58:14Z")

</div>

You are lucky. Just enough space available:

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/f/efdee66f2417a4b80880396443a541f15c16e627.png)

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [16 November 2021 22:15 UTC](https://discourse.nodered.org/t/multistate-switch-no-output-topic/52145/15 "2021-11-16T22:15:40Z")

</div>

This is now available via version _ **1.2.2** _ in the palette:

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/3/5319a215891b8321b57cfe76bc88c3311e044f30.png)

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [30 November 2021 22:16 UTC](https://discourse.nodered.org/t/multistate-switch-no-output-topic/52145/16 "2021-11-30T22:16:28Z")

</div>

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