# Ignore propertyChange script on load

**URL:** <https://forum.inductiveautomation.com/t/ignore-propertychange-script-on-load/18190>\
**Category:** Ignition\
**Tags:** ignition79, scripting\
**Created:** [May 28, 2018, 6:58pm UTC](https://forum.inductiveautomation.com/t/ignore-propertychange-script-on-load/18190 "2018-05-28T18:58:22Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![witman](https://avatars.discourse-cdn.com/v4/letter/w/d2c977/32.png) [@witman](https://forum.inductiveautomation.com/u/witman)\
**Post date:** [May 29, 2018, 12:15am UTC](https://forum.inductiveautomation.com/t/ignore-propertychange-script-on-load/18190/5 "2018-05-29T00:15:48Z")

</div>

I was going to suggest an expression binding on your entryHours template property something like this:

```auto
({Root Container.entryEnd.dateInMillis}-{Root Container.entryStart.dateInMillis})/(1000.0*60.0*60.0)

```

But after reading more closely, I understand you do not want the value here to _always_ reflect the difference between start and end time like it would with the expression binding. Instead, it should maintain the value it receives via the custom property until a user changes the start or end time. Would adding a condition to your if statement something like this accomplish what you’re looking for?

```auto
#If the time was changed, save the differennce between the two to the hour input
if (event.propertyName == 'dateValue' and event.newValue != event.oldValue):

```

Depending on what’s available in your Ignition version (not sure if this was in older versions), you could drop a couple lines from your script, if desired, by using the dateInMillis property instead of dateValue.On the other hand, results using dateInMillis may not always be what you expect:  
[http://forum.inductiveautomation.com/t/spinner-control-issue/7512](http://forum.inductiveautomation.com/t/spinner-control-issue/7512)

---

_[View the full topic](https://forum.inductiveautomation.com/t/ignore-propertychange-script-on-load/18190)._
