# Reset Tag Value after a Number of Seconds

**URL:** <https://forum.inductiveautomation.com/t/reset-tag-value-after-a-number-of-seconds/17098>\
**Category:** Ignition\
**Created:** [February 22, 2018, 6:05pm UTC](https://forum.inductiveautomation.com/t/reset-tag-value-after-a-number-of-seconds/17098 "2018-02-22T18:05:52Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![bfuson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bfuson/32/4597_2.png) [@bfuson](https://forum.inductiveautomation.com/u/bfuson)\
**Post date:** [February 22, 2018, 6:18pm UTC](https://forum.inductiveautomation.com/t/reset-tag-value-after-a-number-of-seconds/17098/2 "2018-02-22T18:18:47Z")

</div>

Make another tag of type Date to store the time of your existing tags last transition. In your existing tag, add an OnValueChange event script that sets your new date tag to system.date.now() whenever  
`previousValue.value != currentValue.value`  
Then make a third tag, an expression tag, that evaluates to the time between the above date tag and now(). Give it an OnValueChange event script that checks if the currentValue.value is greater than your predefined number of seconds. If it is, then reset your existing tag to the default.

See this post for something similar: [Timer function that works gloabally(gateway)](http://forum.inductiveautomation.com/t/timer-function-that-works-gloabally-gateway/16849/4?u=bfuson)

---

_[View the full topic](https://forum.inductiveautomation.com/t/reset-tag-value-after-a-number-of-seconds/17098)._
