# Dropdown node wont refresh text output .It will only do it after URL refresh

**URL:** https://discourse.nodered.org/t/dropdown-node-wont-refresh-text-output-it-will-only-do-it-after-url-refresh/44951
**Category:** Dashboard
**Created:** [29 April 2021 20:07 UTC](https://discourse.nodered.org/t/dropdown-node-wont-refresh-text-output-it-will-only-do-it-after-url-refresh/44951 "2021-04-29T20:07:38Z")
**Posts on this page:** 20
**Page:** 2

<div class="post-metadata">

### Author: ![diaz\_1988](https://avatars.discourse-cdn.com/v4/letter/d/e68b1a/32.png) [@diaz\_1988](https://discourse.nodered.org/u/diaz_1988)
#### Post date: [30 April 2021 09:49 UTC](https://discourse.nodered.org/t/dropdown-node-wont-refresh-text-output-it-will-only-do-it-after-url-refresh/44951/21 "2021-04-30T09:49:52Z")

</div>

i investigated it and for my eyes it is related to the dropdown node . i really do not have the knoweledge to troubleshoot its configuration .Colin could i send you a video through emailo or somehow?

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [30 April 2021 10:39 UTC](https://discourse.nodered.org/t/dropdown-node-wont-refresh-text-output-it-will-only-do-it-after-url-refresh/44951/22 "2021-04-30T10:39:48Z")

</div>

It isn't to do with the dropdown node because you said if you bypass the persist node, and send the dropdown node the same message from an inject node then it works ok. Post the flow that fails and the one that works and show us the message that is sent to the dropdown node in each case (in debug nodes). Set the debug nodes to show Complete message. Give the debug nodes names so that it is clear which output is which.

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [30 April 2021 12:32 UTC](https://discourse.nodered.org/t/dropdown-node-wont-refresh-text-output-it-will-only-do-it-after-url-refresh/44951/23 "2021-04-30T12:32:20Z")

</div>

Something has just occurred to me, how are you checking what you are sending to the dropdown node on startup? You can't see it in the editor because the browser will not be open in the editor to see it. Presumably you have configured the debug node to output to the console and then viewed it there.

---

<div class="post-metadata">

### Author: ![diaz\_1988](https://avatars.discourse-cdn.com/v4/letter/d/e68b1a/32.png) [@diaz\_1988](https://discourse.nodered.org/u/diaz_1988)
#### Post date: [30 April 2021 12:43 UTC](https://discourse.nodered.org/t/dropdown-node-wont-refresh-text-output-it-will-only-do-it-after-url-refresh/44951/24 "2021-04-30T12:43:14Z")

</div>

i use a delay before feeding to the dropdown node

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [30 April 2021 12:45 UTC](https://discourse.nodered.org/t/dropdown-node-wont-refresh-text-output-it-will-only-do-it-after-url-refresh/44951/25 "2021-04-30T12:45:07Z")

</div>

What is that in answer to?

---

<div class="post-metadata">

### Author: ![diaz\_1988](https://avatars.discourse-cdn.com/v4/letter/d/e68b1a/32.png) [@diaz\_1988](https://discourse.nodered.org/u/diaz_1988)
#### Post date: [30 April 2021 12:47 UTC](https://discourse.nodered.org/t/dropdown-node-wont-refresh-text-output-it-will-only-do-it-after-url-refresh/44951/28 "2021-04-30T12:47:34Z")

</div>

"how are you checking what you are sending to the dropdown node on startup?" its a responce to this question .

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [30 April 2021 12:51 UTC](https://discourse.nodered.org/t/dropdown-node-wont-refresh-text-output-it-will-only-do-it-after-url-refresh/44951/29 "2021-04-30T12:51:56Z")

</div>

You said you have a three second delay. That is not long enough on boot to open a browser on the editor, is it?

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [30 April 2021 12:58 UTC](https://discourse.nodered.org/t/dropdown-node-wont-refresh-text-output-it-will-only-do-it-after-url-refresh/44951/31 "2021-04-30T12:58:37Z")

</div>

OK, so let me make sure I understand. You reboot, open the browser on the editor and on the dashboard, then wait for the inject to trigger, but it does not update the dropdown?

Then you look in the editor window and you can see the message that was sent and it looks ok.

If you then manually click the inject does it update the dropdown?

You said it _does_ work if you drive it directly from an Inject node. If you now click that inject node does it then update the dropdown? If yes then the messages must be different. So please do what I asked ages ago which is to show us those messages, the one that works and the one that doesn't. Also post the flow with the failing and working flows on it.

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [30 April 2021 13:03 UTC](https://discourse.nodered.org/t/dropdown-node-wont-refresh-text-output-it-will-only-do-it-after-url-refresh/44951/32 "2021-04-30T13:03:10Z")

</div>

Please read post #7, starting: In order to make code more readable ...

---

<div class="post-metadata">

### Author: ![diaz\_1988](https://avatars.discourse-cdn.com/v4/letter/d/e68b1a/32.png) [@diaz\_1988](https://discourse.nodered.org/u/diaz_1988)
#### Post date: [30 April 2021 13:05 UTC](https://discourse.nodered.org/t/dropdown-node-wont-refresh-text-output-it-will-only-do-it-after-url-refresh/44951/33 "2021-04-30T13:05:49Z")

</div>

[flows (33).json](https://discourse.nodered.org/uploads/short-url/yILnlEw3Kmx5RZr6ynOYkC6G3bl.json) (3.1 KB)

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [30 April 2021 13:26 UTC](https://discourse.nodered.org/t/dropdown-node-wont-refresh-text-output-it-will-only-do-it-after-url-refresh/44951/34 "2021-04-30T13:26:49Z")

</div>

That is not what post #7 says.

See this post for more how to post flows - [How to share code or flow json](https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506)

Edit, also you have not included the Inject node that does work.  
Can you also confirm that my understanding in post #31 is entirely correct please.

---

<div class="post-metadata">

### Author: ![diaz\_1988](https://avatars.discourse-cdn.com/v4/letter/d/e68b1a/32.png) [@diaz\_1988](https://discourse.nodered.org/u/diaz_1988)
#### Post date: [30 April 2021 13:41 UTC](https://discourse.nodered.org/t/dropdown-node-wont-refresh-text-output-it-will-only-do-it-after-url-refresh/44951/35 "2021-04-30T13:41:43Z")

</div>

All you said in post 31 is correct . plus that if i refresh the url of the 1880/ui page the output appears correctly also in he ui wihout any change happen to node-red in the meanwhile.

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [30 April 2021 13:48 UTC](https://discourse.nodered.org/t/dropdown-node-wont-refresh-text-output-it-will-only-do-it-after-url-refresh/44951/36 "2021-04-30T13:48:03Z")

</div>

> [@diaz\_1988](#):
>
> which of all is post #31?

The forum shows the post number of the post which is at the top of the window, on the right hand side. It is the one starting "OK, so let me make sure I understand".

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [30 April 2021 15:57 UTC](https://discourse.nodered.org/t/dropdown-node-wont-refresh-text-output-it-will-only-do-it-after-url-refresh/44951/37 "2021-04-30T15:57:09Z")

</div>

Had you taken my advice earlier, to set the debug node to show Full Message you would have seen a clue as to what the problem is. As with most (maybe all) ui nodes when they send a message it contains a property `msg.socketid` which indicates the websocket connection of the browser which caused the message to be sent. Also, as with other ui nodes, if you send it a message that contains a socketid then only the matching browser session will be affected.

The message that you are persisting contains the socketid of the browser session that selected the value in the dropdown, but having restarted the flows that connection is lost and the browser will start a new connection when it reconnects. The message stored in the persist node is then passed to the dropdown node, but that message includes the id of socket from the previous run. That id does not match the new connection so the display is not updated.

To fix it add a Change node in the wire out of the persist node, set to Delete msg.socketid, then I think you will find it works ok.

Alternative ditch the persist node, which, when used with nodejs 14, produces a warning message:

"[RED.events] Deprecated use of "nodes-started" event from "/home/colinl/.node-red/node\_modules/node-red-contrib-persist/persist.js:164:20". Use "flows:started" instead."

and switch to using persistent context. Then you can just save the payload value and inject it via an Inject node on startup, so you won't need the Change node and also you wont have to worry about whether the persist node will stop working at some point when you upgrade your system.

---

<div class="post-metadata">

### Author: ![diaz\_1988](https://avatars.discourse-cdn.com/v4/letter/d/e68b1a/32.png) [@diaz\_1988](https://discourse.nodered.org/u/diaz_1988)
#### Post date: [30 April 2021 17:46 UTC](https://discourse.nodered.org/t/dropdown-node-wont-refresh-text-output-it-will-only-do-it-after-url-refresh/44951/38 "2021-04-30T17:46:19Z")

</div>

Dear Colin thank you very much for the support .You r n1.

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [1 May 2021 08:18 UTC](https://discourse.nodered.org/t/dropdown-node-wont-refresh-text-output-it-will-only-do-it-after-url-refresh/44951/39 "2021-05-01T08:18:14Z")

</div>

I don't think you should need the Delay node either.

---

<div class="post-metadata">

### Author: ![diaz\_1988](https://avatars.discourse-cdn.com/v4/letter/d/e68b1a/32.png) [@diaz\_1988](https://discourse.nodered.org/u/diaz_1988)
#### Post date: [1 May 2021 08:32 UTC](https://discourse.nodered.org/t/dropdown-node-wont-refresh-text-output-it-will-only-do-it-after-url-refresh/44951/40 "2021-05-01T08:32:33Z")

</div>

i have an mqtt in node feeding also the dropdown . but there is one issue. on redeploy the mqtt in node fires a message to the dropdown node changing the state so i use a delay in order to override this mqtt in message. I tried to put an rbe node to ignore the initial state of mqtt in node but i have problem because in that point of the flow i must toggle sometimes using the same msg with the last one and with rbe it cant work.

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [1 May 2021 10:19 UTC](https://discourse.nodered.org/t/dropdown-node-wont-refresh-text-output-it-will-only-do-it-after-url-refresh/44951/41 "2021-05-01T10:19:30Z")

</div>

Is it sending a value on deploy because something is publishing at that time or because the topic is retained?

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [2 May 2021 08:42 UTC](https://discourse.nodered.org/t/dropdown-node-wont-refresh-text-output-it-will-only-do-it-after-url-refresh/44951/42 "2021-05-02T08:42:43Z")

</div>

In fact if you are already using MQTT there is a much better way to do what you want. You don't need the persist node or persistent context. You can use MQTT. Wire it like this

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

Make sure that `If msg arrives on input, pass through to Output` is _not_ set (that is important or you will get an MQTT loop) and make sure the topic is set as Retained in the MQTT Out node.

A big advantage of structuring like that is that you can keep the control logic (what happens when the value changes) separate from the UI nodes. It doesn't even need to be in the same computer.

---

<div class="post-metadata">

### Author: ![diaz\_1988](https://avatars.discourse-cdn.com/v4/letter/d/e68b1a/32.png) [@diaz\_1988](https://discourse.nodered.org/u/diaz_1988)
#### Post date: [2 May 2021 08:46 UTC](https://discourse.nodered.org/t/dropdown-node-wont-refresh-text-output-it-will-only-do-it-after-url-refresh/44951/43 "2021-05-02T08:46:16Z")

</div>

Colin , its a script on a esp and i dont know why it is sending the value when the node red is re-deployed . Even if i shutdown the esp and restart node-red It is sending the value again on deploy .

[Previous page](https://discourse.nodered.org/t/dropdown-node-wont-refresh-text-output-it-will-only-do-it-after-url-refresh/44951.md?page=1)

[Next page](https://discourse.nodered.org/t/dropdown-node-wont-refresh-text-output-it-will-only-do-it-after-url-refresh/44951.md?page=3)
