# Trying to save numeric input to varible and recall it for funtion input

**URL:** <https://discourse.nodered.org/t/trying-to-save-numeric-input-to-varible-and-recall-it-for-funtion-input/28697>\
**Category:** General\
**Created:** [21 June 2020 19:40 UTC](https://discourse.nodered.org/t/trying-to-save-numeric-input-to-varible-and-recall-it-for-funtion-input/28697 "2020-06-21T19:40:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rmystique](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rmystique/32/84365_2.png) [@rmystique](https://discourse.nodered.org/u/rmystique)\
**Post date:** [21 June 2020 19:40 UTC](https://discourse.nodered.org/t/trying-to-save-numeric-input-to-varible-and-recall-it-for-funtion-input/28697/1 "2020-06-21T19:40:23Z")

</div>

I am trying to use a numeric input to be able to adjust a timer off delay, but becuase the numeric input node only sends when changed I am trying to save the value to a varible and have a function use that varible to add it to the flow each time the timer is started, But I dont know how to do the varible part properly, here is what i have at the moment:

```auto
[{"id":"63d6e846.0e8318","type":"ui_led","z":"4f2cae6a.c5ec8","group":"a92077cf.7a28e8","order":4,"width":0,"height":0,"label":"Test","labelPlacement":"left","labelAlignment":"left","colorForValue":[{"color":"red","value":"0","valueType":"num"},{"color":"green","value":"1","valueType":"num"}],"allowColorForValueInMessage":false,"name":"","x":750,"y":460,"wires":[]},{"id":"3ca31c67.d88c54","type":"inject","z":"4f2cae6a.c5ec8","name":"test","topic":"","payload":"1","payloadType":"num","repeat":"10","crontab":"","once":true,"onceDelay":"5","x":210,"y":460,"wires":[["304b5c38.c56534","63d6e846.0e8318","741a76e9.40e718"]]},{"id":"304b5c38.c56534","type":"change","z":"4f2cae6a.c5ec8","name":"Water off","rules":[{"t":"change","p":"payload","pt":"msg","from":"1","fromt":"num","to":"0","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":540,"wires":[["3ad0e86d.368b98"]]},{"id":"3ad0e86d.368b98","type":"delay","z":"4f2cae6a.c5ec8","name":"Off Delay","pauseType":"delayv","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":600,"y":540,"wires":[["63d6e846.0e8318"]]},{"id":"741a76e9.40e718","type":"change","z":"4f2cae6a.c5ec8","name":"","rules":[{"t":"move","p":"payload","pt":"msg","to":"delay","tot":"msg"},{"t":"set","p":"delay","pt":"msg","to":"delay_value","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":420,"y":500,"wires":[["3ad0e86d.368b98","f8f972f2.0e18f"]]},{"id":"f8f972f2.0e18f","type":"debug","z":"4f2cae6a.c5ec8","name":"","active":true,"tosidebar":false,"console":false,"tostatus":true,"complete":"delay","targetType":"msg","x":730,"y":380,"wires":[]},{"id":"cde19d5b.bf893","type":"ui_numeric","z":"4f2cae6a.c5ec8","name":"","label":"numeric","tooltip":"","group":"a92077cf.7a28e8","order":5,"width":0,"height":0,"wrap":false,"passthru":true,"topic":"","format":"{{value}}","min":"1","max":10,"step":1,"x":340,"y":420,"wires":[["6eadcd45.8a6574"]]},{"id":"6eadcd45.8a6574","type":"change","z":"4f2cae6a.c5ec8","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"delay_value","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":420,"wires":[[]]},{"id":"a92077cf.7a28e8","type":"ui_group","z":"","name":"dashboard","tab":"7dd97b74.960734","order":1,"disp":true,"width":"6","collapse":false},{"id":"7dd97b74.960734","type":"ui_tab","z":"","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]

```

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [22 June 2020 10:20 UTC](https://discourse.nodered.org/t/trying-to-save-numeric-input-to-varible-and-recall-it-for-funtion-input/28697/2 "2020-06-22T10:20:03Z")

</div>

Try somthing like this

```auto
[{"id":"7ea2b8f6.95d74","type":"tab","label":"Flow 5","disabled":false,"info":""},{"id":"e8f111b0.9ef518","type":"inject","z":"7ea2b8f6.95d74","name":"test","topic":"","payload":"1","payloadType":"num","repeat":"10","crontab":"","once":true,"onceDelay":"5","x":120,"y":200,"wires":[["f833bb4f.37caa8"]]},{"id":"dda8e07.9e065a","type":"delay","z":"7ea2b8f6.95d74","name":"Off Delay","pauseType":"delayv","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":490,"y":200,"wires":[["752fafa1.e17b1"]]},{"id":"f833bb4f.37caa8","type":"change","z":"7ea2b8f6.95d74","name":"","rules":[{"t":"set","p":"delay","pt":"msg","to":"delay","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":320,"y":200,"wires":[["dda8e07.9e065a"]]},{"id":"b66140c7.eb97c","type":"ui_numeric","z":"7ea2b8f6.95d74","name":"","label":"numeric","tooltip":"","group":"6293e9bc.df8968","order":5,"width":0,"height":0,"wrap":false,"passthru":true,"topic":"","format":"","min":"1","max":10,"step":1,"x":240,"y":120,"wires":[["f0154e6e.9bbf28"]]},{"id":"f0154e6e.9bbf28","type":"change","z":"7ea2b8f6.95d74","name":"","rules":[{"t":"set","p":"delay","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":120,"wires":[[]]},{"id":"752fafa1.e17b1","type":"debug","z":"7ea2b8f6.95d74","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":630,"y":200,"wires":[]},{"id":"6293e9bc.df8968","type":"ui_group","z":"","name":"Default","tab":"a1e95e9e.580868","order":1,"disp":false,"width":"6","collapse":false},{"id":"a1e95e9e.580868","type":"ui_tab","z":"","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]

```

---

<div class="post-metadata">

**Author:** ![rmystique](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rmystique/32/84365_2.png) [@rmystique](https://discourse.nodered.org/u/rmystique)\
**Post date:** [23 June 2020 05:49 UTC](https://discourse.nodered.org/t/trying-to-save-numeric-input-to-varible-and-recall-it-for-funtion-input/28697/3 "2020-06-23T05:49:49Z")

</div>

It was setting the msg.flow that got me there, Thank you

---

<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:** [7 July 2020 05:57 UTC](https://discourse.nodered.org/t/trying-to-save-numeric-input-to-varible-and-recall-it-for-funtion-input/28697/4 "2020-07-07T05:57:31Z")

</div>

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