# Dropdown previous value

**URL:** <https://forum.inductiveautomation.com/t/dropdown-previous-value/93765>\
**Category:** Ignition\
**Tags:** ignition79, scripting\
**Created:** [July 25, 2024, 6:46pm UTC](https://forum.inductiveautomation.com/t/dropdown-previous-value/93765 "2024-07-25T18:46:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sathianandan.dharmas](https://avatars.discourse-cdn.com/v4/letter/s/53a042/32.png) [@sathianandan.dharmas](https://forum.inductiveautomation.com/u/sathianandan.dharmas)\
**Post date:** [July 25, 2024, 6:46pm UTC](https://forum.inductiveautomation.com/t/dropdown-previous-value/93765/1 "2024-07-25T18:46:01Z")

</div>

Hi Team,

Is there any direct or indirect way to get the previousValue or oldValue from a dropdown. It can be either 'selected Value' or 'selected Label' property.

Thanks in advance!  
Sam

---

<div class="post-metadata">

**Author:** ![Samuel\_Sueur](https://avatars.discourse-cdn.com/v4/letter/s/e36b37/32.png) [@Samuel\_Sueur](https://forum.inductiveautomation.com/u/Samuel_Sueur)\
**Post date:** [July 25, 2024, 6:50pm UTC](https://forum.inductiveautomation.com/t/dropdown-previous-value/93765/2 "2024-07-25T18:50:40Z")

</div>

EDIT: My answer was irrelevant as this is Ignition 7.9 as pointed out by Louis below. Sorry !

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [July 25, 2024, 6:57pm UTC](https://forum.inductiveautomation.com/t/dropdown-previous-value/93765/3 "2024-07-25T18:57:46Z")

</div>

> [@Samuel\_Sueur](#):
>
> changeScript on the value property ?

Careful, it's marked as Ignition 7.9 so not Perspective.

@sathianandan.dharmas

On the component add a propertyChange script, then you would use something similar to this code.

```python
if event.propertyName == 'selectedValue':
    oldValue = event.oldValue

```

---

<div class="post-metadata">

**Author:** ![tyler.bennett](https://avatars.discourse-cdn.com/v4/letter/t/f04885/32.png) [@tyler.bennett](https://forum.inductiveautomation.com/u/tyler.bennett)\
**Post date:** [July 25, 2024, 6:58pm UTC](https://forum.inductiveautomation.com/t/dropdown-previous-value/93765/4 "2024-07-25T18:58:20Z")

</div>

I have in the past made it so that each new manually entered value in the drop down gets added to the list of available items (options) in the drop down. Is that what you are trying to do.

My experience was using Perspective drop down component.... but I see you have tagged the post as Ignition v7.9 (no Perspective).

---

<div class="post-metadata">

**Author:** ![sathianandan.dharmas](https://avatars.discourse-cdn.com/v4/letter/s/53a042/32.png) [@sathianandan.dharmas](https://forum.inductiveautomation.com/u/sathianandan.dharmas)\
**Post date:** [July 25, 2024, 7:43pm UTC](https://forum.inductiveautomation.com/t/dropdown-previous-value/93765/5 "2024-07-25T19:43:54Z")

</div>

Hi @lrose , that worked. I don't know why I didn't think of that.

Thanks a lot for the quick response!
