# Restricting the data value of custom Range

**URL:** <https://forum.inductiveautomation.com/t/restricting-the-data-value-of-custom-range/69818>\
**Category:** Ignition\
**Tags:** ignition79, python, ignition80, vision, scripting\
**Created:** [February 14, 2023, 12:27pm UTC](https://forum.inductiveautomation.com/t/restricting-the-data-value-of-custom-range/69818 "2023-02-14T12:27:21Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adarsh\_Shelar](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@Adarsh\_Shelar](https://forum.inductiveautomation.com/u/Adarsh_Shelar)\
**Post date:** [February 14, 2023, 12:27pm UTC](https://forum.inductiveautomation.com/t/restricting-the-data-value-of-custom-range/69818/1 "2023-02-14T12:27:21Z")

</div>

Hi.  
There is a custom property (integer datatype).  
If values of this property go beyond 100 it should become as 100 and if values, go less than 0 then values should stay at so basically, it's like restricting values within 0 to 100. We have to achieve this using scripting or expression.

Thank you!

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [February 14, 2023, 12:51pm UTC](https://forum.inductiveautomation.com/t/restricting-the-data-value-of-custom-range/69818/2 "2023-02-14T12:51:11Z")

</div>

Where is this data coming from: a tag, or some type of component like a table or numeric text field?

---

<div class="post-metadata">

**Author:** ![Adarsh\_Shelar](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@Adarsh\_Shelar](https://forum.inductiveautomation.com/u/Adarsh_Shelar)\
**Post date:** [February 14, 2023, 12:53pm UTC](https://forum.inductiveautomation.com/t/restricting-the-data-value-of-custom-range/69818/3 "2023-02-14T12:53:34Z")

</div>

yes! @justinedwards.jle san.

---

<div class="post-metadata">

**Author:** ![Adarsh\_Shelar](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@Adarsh\_Shelar](https://forum.inductiveautomation.com/u/Adarsh_Shelar)\
**Post date:** [February 14, 2023, 1:13pm UTC](https://forum.inductiveautomation.com/t/restricting-the-data-value-of-custom-range/69818/4 "2023-02-14T13:13:41Z")

</div>

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/2/02865442289ad4c6ee8ce30ead3ef4fc6faa8dbf.png)  
This is the expression I have used.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 14, 2023, 1:28pm UTC](https://forum.inductiveautomation.com/t/restricting-the-data-value-of-custom-range/69818/5 "2023-02-14T13:28:12Z")

</div>

See this similar discussion:

> [@Custom property](https://forum.inductiveautomation.com/t/custom-property/69820):
>
> Hi, There is a custom property (integer datatype). If values of this property go beyond 100 it should become as 100 and if values, go less than 0 then values should stay at so basically, it's like restricting values within 0 to 100. We have to achieve this using scripting or expression. Thanks

I'm going to guess you work with @Watson_Durom? Or is this part of an exam?

---

<div class="post-metadata">

**Author:** ![Adarsh\_Shelar](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@Adarsh\_Shelar](https://forum.inductiveautomation.com/u/Adarsh_Shelar)\
**Post date:** [February 14, 2023, 1:38pm UTC](https://forum.inductiveautomation.com/t/restricting-the-data-value-of-custom-range/69818/6 "2023-02-14T13:38:05Z")

</div>

**Yes! Thank you,**
