# Setting min and max value for custom property

**URL:** <https://forum.inductiveautomation.com/t/setting-min-and-max-value-for-custom-property/5652>\
**Category:** Ignition\
**Created:** [January 7, 2013, 3:17pm UTC](https://forum.inductiveautomation.com/t/setting-min-and-max-value-for-custom-property/5652 "2013-01-07T15:17:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rcorkern](https://avatars.discourse-cdn.com/v4/letter/r/90db22/32.png) [@rcorkern](https://forum.inductiveautomation.com/u/rcorkern)\
**Post date:** [January 7, 2013, 3:17pm UTC](https://forum.inductiveautomation.com/t/setting-min-and-max-value-for-custom-property/5652/1 "2013-01-07T15:17:49Z")

</div>

Can a min and max value be set for a custom property and if so how?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![James.Lorenz](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/james.lorenz/32/3290_2.png) [@James.Lorenz](https://forum.inductiveautomation.com/u/James.Lorenz)\
**Post date:** [January 7, 2013, 6:02pm UTC](https://forum.inductiveautomation.com/t/setting-min-and-max-value-for-custom-property/5652/2 "2013-01-07T18:02:03Z")

</div>

You can use an expression binding on the custom property to enforce min/max limits. For example, this expression enforces a min/max of 0/25, and if the value is outside of that range, it will set it to an appropriate closest value (0 if less than 0, 25 if greater than 25). This assumes your custom property is bound to a tag, you can replace those references with a component property as well.

```auto
if({path/to/tag}>25,25,if({path/to/tag}<0,0,{path/to/tag}))
```
