# How to Initialize a slider AND indicate a change

**URL:** <https://discourse.nodered.org/t/how-to-initialize-a-slider-and-indicate-a-change/74717>\
**Category:** Dashboard\
**Created:** [5 February 2023 01:08 UTC](https://discourse.nodered.org/t/how-to-initialize-a-slider-and-indicate-a-change/74717 "2023-02-05T01:08:14Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![nfarrier](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nfarrier/32/75596_2.png) [@nfarrier](https://discourse.nodered.org/u/nfarrier)\
**Post date:** [5 February 2023 01:08 UTC](https://discourse.nodered.org/t/how-to-initialize-a-slider-and-indicate-a-change/74717/1 "2023-02-05T01:08:14Z")

</div>

I have a Slider change a Gauge and also sends the position on to an Arduino. I've added an Inject node to initialize the Slider's position when the flow is deployed, which does change the Slider's position, but that number isn't being sent on to the Gauge or the Arduino.

How can I get the Slider to initialize AND think it was changed so it also passes on the initialized variable to the Arduino?

---

<div class="post-metadata">

**Author:** ![smanjunath211](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/smanjunath211/32/95742_2.png) [@smanjunath211](https://discourse.nodered.org/u/smanjunath211)\
**Post date:** [5 February 2023 04:24 UTC](https://discourse.nodered.org/t/how-to-initialize-a-slider-and-indicate-a-change/74717/2 "2023-02-05T04:24:51Z")

</div>

Welcome to the Forum.  
have you ticked this box in the settings of slider control ?

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

---

<div class="post-metadata">

**Author:** ![nfarrier](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nfarrier/32/75596_2.png) [@nfarrier](https://discourse.nodered.org/u/nfarrier)\
**Post date:** [5 February 2023 04:57 UTC](https://discourse.nodered.org/t/how-to-initialize-a-slider-and-indicate-a-change/74717/3 "2023-02-05T04:57:32Z")

</div>

Thank you. Yes. That box is checked, and it also makes no difference whether the slider's output is on release or continuous.

---

<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:** [5 February 2023 07:59 UTC](https://discourse.nodered.org/t/how-to-initialize-a-slider-and-indicate-a-change/74717/5 "2023-02-05T07:59:45Z")

</div>

Also connect the inject node direct to the gauge and the Arduino.

---

<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:** [5 February 2023 10:05 UTC](https://discourse.nodered.org/t/how-to-initialize-a-slider-and-indicate-a-change/74717/6 "2023-02-05T10:05:50Z")

</div>

1. What version of NR and node.js are you running? (you can get this from the startup log)
2. what are you sending out of the `inject` node?
3. if you add a `debug` node to the output of the `slider` node, what do you see?

Note the slider does not pass msg's on unless the value changes. This is from the `Help` tab of the slider node:

> An input `msg.payload` will be converted to a number, and used to preset a value. The **min** value will be used if conversion fails, and it will update the user interface. **If the value changes, it will also be passed to the output.**

---

<div class="post-metadata">

**Author:** ![nfarrier](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nfarrier/32/75596_2.png) [@nfarrier](https://discourse.nodered.org/u/nfarrier)\
**Post date:** [5 February 2023 13:10 UTC](https://discourse.nodered.org/t/how-to-initialize-a-slider-and-indicate-a-change/74717/8 "2023-02-05T13:10:13Z")

</div>

Thank you all for your help. Based on zenofmud, I realized that sometimes when the flow deployed, there wasn't any change, so I added a 2nd Inject node set to 0.05 sec BEFORE my initializing Inject node and set the value to different number before really initializing it. That triggered a value change and passed it as an output.

Not elegant, but it works for now. Thanks again.

---

<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:** [19 February 2023 13:10 UTC](https://discourse.nodered.org/t/how-to-initialize-a-slider-and-indicate-a-change/74717/9 "2023-02-19T13:10:30Z")

</div>

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