# Write Slide Value

**URL:** <https://discourse.nodered.org/t/write-slide-value/7450>\
**Category:** General\
**Created:** [31 January 2019 21:54 UTC](https://discourse.nodered.org/t/write-slide-value/7450 "2019-01-31T21:54:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rogier](https://avatars.discourse-cdn.com/v4/letter/r/ecc23a/32.png) [@rogier](https://discourse.nodered.org/u/rogier)\
**Post date:** [31 January 2019 21:54 UTC](https://discourse.nodered.org/t/write-slide-value/7450/1 "2019-01-31T21:54:27Z")

</div>

can anyone help me with this one?  
i have a DDC controller, i can write value with this request:

[http://192.168.1.240/root?resource=WriteProperty&jsoncode={"index"%3A335938824%2C"property"%3A85%2C"value"%3A45}&callback=\_jqjsp&\_1548966493485=](http://192.168.1.240/root?resource=WriteProperty&jsoncode=%7B%22index%22%3A335938824%2C%22property%22%3A85%2C%22value%22%3A45%7D&callback=_jqjsp&_1548966493485=)

the value Writing is now 45. now i want to use the slider to change the value and send it.  
i tried to use the http request node like this:  
[http://192.168.1.240/root?resource=WriteProperty&jsoncode={"index"%3A335938824%2C"property"%3A85%2C"value"%3A{msg.payload}](http://192.168.1.240/root?resource=WriteProperty&jsoncode=%7B%22index%22%3A335938824%2C%22property%22%3A85%2C%22value%22%3A%7Bmsg.payload%7D)}&callback=\_jqjsp&\_1548966493485=

but it doesn't work. does anyone has an idea?

thanks..

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [31 January 2019 21:58 UTC](https://discourse.nodered.org/t/write-slide-value/7450/2 "2019-01-31T21:58:38Z")

</div>

try building the url in a function node and passing that to the http request node.

That way you can also use a debug to see what you have defined and where you might be going wrong.

---

<div class="post-metadata">

**Author:** ![rogier](https://avatars.discourse-cdn.com/v4/letter/r/ecc23a/32.png) [@rogier](https://discourse.nodered.org/u/rogier)\
**Post date:** [2 February 2019 11:05 UTC](https://discourse.nodered.org/t/write-slide-value/7450/3 "2019-02-02T11:05:22Z")

</div>

thanks for your feedback,

I have tried to write the function node but do not get it working. tried several things. I think it should look like this:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/1/104a68aa1ca3c5b9f5042a1d1099796b9bec265a.png)

```auto
[{"id":"52da13b5.537f4c","type":"ui_slider","z":"912a3768.44dad8","name":"","label":"slider","tooltip":"","group":"369ad7fb.53ec58","order":0,"width":"6","height":"1","passthru":true,"outs":"all","topic":"","min":"35","max":"45","step":"1","x":490,"y":160,"wires":[["818cb14b.c0e95"]]},{"id":"818cb14b.c0e95","type":"function","z":"912a3768.44dad8","name":"Slider into HTTP request","func":"var msg = {\n method: 'get',\n url: 'http://192.168.1.240/root?resource=WriteProperty&jsoncode={%22index%22%3A335938824%2C%22property%22%3A85%2C%22value%22%3A :msg.payload }}&callback=_jqjsp&_1548966493485='\n};\nreturn msg;\n","outputs":1,"noerr":0,"x":730,"y":160,"wires":[["3b5a97d0.dd5ea8"]]},{"id":"3b5a97d0.dd5ea8","type":"http request","z":"912a3768.44dad8","name":"","method":"use","ret":"txt","url":"","tls":"","x":990,"y":160,"wires":[[]]},{"id":"369ad7fb.53ec58","type":"ui_group","z":"","name":"Woonkamer","tab":"856afc2a.9be24","disp":true,"width":"6","collapse":false},{"id":"856afc2a.9be24","type":"ui_tab","z":"","name":"Woonkamer","icon":"dashboard","order":2,"disabled":false,"hidden":false}]

```

what am I doing wrong??

---

<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 February 2019 11:40 UTC](https://discourse.nodered.org/t/write-slide-value/7450/4 "2019-02-02T11:40:55Z")

</div>

If you look at the result in a debug node does it look correct?  
Also your flow is not importable, you need to edit the previous post as described in [How to share code or flow json](https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506)

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [2 February 2019 12:32 UTC](https://discourse.nodered.org/t/write-slide-value/7450/5 "2019-02-02T12:32:54Z")

</div>

That’s not how you concatenate strings in javascript  
see

[http://2ality.com/2011/10/string-concatenation.html](http://2ality.com/2011/10/string-concatenation.html)
