# Gateway scripting - previous value

**URL:** <https://forum.inductiveautomation.com/t/gateway-scripting-previous-value/64568>\
**Category:** Ignition\
**Created:** [September 27, 2022, 8:35pm UTC](https://forum.inductiveautomation.com/t/gateway-scripting-previous-value/64568 "2022-09-27T20:35:34Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [September 27, 2022, 8:39pm UTC](https://forum.inductiveautomation.com/t/gateway-scripting-previous-value/64568/2 "2022-09-27T20:39:18Z")

</div>

What doesn’t work about it?

Keep in mind the first time the script executes there is no previous value, so it will be null / Python `None`, which you need to check for before you try to access its value component.

---

_[View the full topic](https://forum.inductiveautomation.com/t/gateway-scripting-previous-value/64568)._
