# Gateway tag change or Gateway timer scripts expressions and delays

**URL:** <https://forum.inductiveautomation.com/t/gateway-tag-change-or-gateway-timer-scripts-expressions-and-delays/39147>\
**Category:** Ignition\
**Created:** [September 28, 2020, 9:40pm UTC](https://forum.inductiveautomation.com/t/gateway-tag-change-or-gateway-timer-scripts-expressions-and-delays/39147 "2020-09-28T21:40:11Z")\
**Posts on this page:** 1\
**Showing post:** 5

<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:** [September 29, 2020, 1:51pm UTC](https://forum.inductiveautomation.com/t/gateway-tag-change-or-gateway-timer-scripts-expressions-and-delays/39147/5 "2020-09-29T13:51:56Z")

</div>

Something like this (I would delegate to a script module):

```auto
tagpaths = ['[default]'+y for y in ['Cond1', 'Cond2', 'NotBefore']]

def conditionalRun(event):
	cond1, cond2, notbefore = [x.value for x in system.tag.readAll(tagpaths)]

	# Check run permissives
	if cond1 and cond2:
		# Check Not Before criteria
		now = system.date.now()
		if now.before(notbefore):
			return
		system.tag.write(tagpaths[-1], system.date.addDays(now, 14))

		# Do actions that must not repeat faster that every two weeks.

```

---

_[View the full topic](https://forum.inductiveautomation.com/t/gateway-tag-change-or-gateway-timer-scripts-expressions-and-delays/39147)._
