# Gauge - Dynamic min and max

**URL:** <https://discourse.nodered.org/t/gauge-dynamic-min-and-max/12132>\
**Category:** Dashboard\
**Created:** [12 June 2019 16:13 UTC](https://discourse.nodered.org/t/gauge-dynamic-min-and-max/12132 "2019-06-12T16:13:56Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [12 July 2019 10:32 UTC](https://discourse.nodered.org/t/gauge-dynamic-min-and-max/12132/10 "2019-07-12T10:32:32Z")

</div>

Here's my test setup.  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/8/88c7d31d9a7401cd21507eb9e3a0a00ccf81d454.png)

This is what I put in the first function node...

> var max = 50;  
> var min = 20;  
> var data = 30;  
> msg = {payload:data,ui\_control:{min:min,max:max},topic:"Soil"};  
> return msg;

The second function node is the same but with different values for max, min and data.

Hope this works for you.

---

_[View the full topic](https://discourse.nodered.org/t/gauge-dynamic-min-and-max/12132)._
