# Feeling Dumb With a Numeric Text Field

**URL:** <https://forum.inductiveautomation.com/t/feeling-dumb-with-a-numeric-text-field/27415>\
**Category:** Ignition\
**Created:** [August 13, 2019, 11:08pm UTC](https://forum.inductiveautomation.com/t/feeling-dumb-with-a-numeric-text-field/27415 "2019-08-13T23:08:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jordan.richardson](https://avatars.discourse-cdn.com/v4/letter/j/94ad74/32.png) [@jordan.richardson](https://forum.inductiveautomation.com/u/jordan.richardson)\
**Post date:** [August 13, 2019, 11:08pm UTC](https://forum.inductiveautomation.com/t/feeling-dumb-with-a-numeric-text-field/27415/1 "2019-08-13T23:08:24Z")

</div>

So to get it out of the way, I am running 7.8.5. The simple answer may be no, but I am trying to store the old value from a text field in a custom property when a new value is entered. I’m doing this through a propertychange script:

```auto
value = event.source.value.oldValue

event.source.OldVal = value

```

However, this is causing me to get the error:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/5/5defb8ba5436fe14cfd7b0ffd1bf769043e1d0ac.png)

Does the numeric text field not have an oldValue attribute, or do I just completely have my code messed up?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [August 13, 2019, 11:33pm UTC](https://forum.inductiveautomation.com/t/feeling-dumb-with-a-numeric-text-field/27415/2 "2019-08-13T23:33:27Z")

</div>

Is that the extent of your code in the `propertyChange` event? If so, then you need to filter it down to _just_ property changes on the `text` property; something like:

```auto
if event.propertyName == "text":
    event.source.OldVal = event.oldValue

```

---

<div class="post-metadata">

**Author:** ![jordan.richardson](https://avatars.discourse-cdn.com/v4/letter/j/94ad74/32.png) [@jordan.richardson](https://forum.inductiveautomation.com/u/jordan.richardson)\
**Post date:** [August 14, 2019, 12:30pm UTC](https://forum.inductiveautomation.com/t/feeling-dumb-with-a-numeric-text-field/27415/3 "2019-08-14T12:30:00Z")

</div>

You nailed it on the head! In hindsight that completely makes sense that it wouldn’t know which value changed unless I specifically told it. Revised code is:

```auto
if event.propertyName == "floatValue":
    event.source.OldVal = event.oldValue

```
