# Inserted options of dropdown disappear after Deploy

**URL:** <https://discourse.nodered.org/t/inserted-options-of-dropdown-disappear-after-deploy/81649>\
**Category:** General\
**Tags:** node-red-dashboard\
**Created:** [28 September 2023 18:17 UTC](https://discourse.nodered.org/t/inserted-options-of-dropdown-disappear-after-deploy/81649 "2023-09-28T18:17:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![thematrixrearwindow](https://avatars.discourse-cdn.com/v4/letter/t/a8b319/32.png) [@thematrixrearwindow](https://discourse.nodered.org/u/thematrixrearwindow)\
**Post date:** [28 September 2023 18:17 UTC](https://discourse.nodered.org/t/inserted-options-of-dropdown-disappear-after-deploy/81649/1 "2023-09-28T18:17:56Z")

</div>

I am inserting some options for a dropdown node.  
Everything went fine, until the next deploy, then the options of the dropdown are gone and the dropdown has empty selections (options).  
When i then insert the options again, they are not taken over.  
If i put in the options directly by hand into the dropdown node and do a deploy and then the insertion of the options, it works.

Why?

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [28 September 2023 18:21 UTC](https://discourse.nodered.org/t/inserted-options-of-dropdown-disappear-after-deploy/81649/2 "2023-09-28T18:21:24Z")

</div>

Please create a small flow demonstrating the issue and paste it to a reply so we can look at it.

---

<div class="post-metadata">

**Author:** ![thematrixrearwindow](https://avatars.discourse-cdn.com/v4/letter/t/a8b319/32.png) [@thematrixrearwindow](https://discourse.nodered.org/u/thematrixrearwindow)\
**Post date:** [28 September 2023 18:37 UTC](https://discourse.nodered.org/t/inserted-options-of-dropdown-disappear-after-deploy/81649/3 "2023-09-28T18:37:16Z")

</div>

[flows.json](https://discourse.nodered.org/uploads/short-url/vLAMiHCIsNc8RpV66otxhUPiAES.json) (4.3 KB)

Here ist the flow^

And here the incoming data from MQTT:

```auto
{
      "options": [{"Markus": "Markus"}, {"Katha": "Katha"}],
      "selection": ['Markus', 'Katha'],
      "room": 'sz',
      "type": "co2"
}

```

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [28 September 2023 20:35 UTC](https://discourse.nodered.org/t/inserted-options-of-dropdown-disappear-after-deploy/81649/4 "2023-09-28T20:35:47Z")

</div>

Ha, this took me a bit to find. If you look at the `change nodes you have this:

![Screenshot 2023-09-28 at 4.28.31 PM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/9/495dd933601924f2e54e14dcd36e51bca3f105ff.png)

So the first thing you do is set `msg.payload` to `msg.payload.selection`

then you `try` to set `msg.options` to `msg.payload.options` but at this point there is no `msg.payload.potions` because you just wiped it out.

If you swap the order of the two actions (set `msg.options` to `msg.payload.options` first) the correct data will be in the msg.

This is where adding `debug' nodes is a valuable problem solving tool.

ALSO, you should change the single quotes

```auto
"selection": ['Markus', 'Katha'],

```

to double quotes in the code that is publishing that data.

---

<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:** [27 November 2023 20:35 UTC](https://discourse.nodered.org/t/inserted-options-of-dropdown-disappear-after-deploy/81649/5 "2023-11-27T20:35:49Z")

</div>

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