# Perspective Property Change Script Broken in Ignition 8.1.47

**URL:** <https://forum.inductiveautomation.com/t/perspective-property-change-script-broken-in-ignition-8-1-47/105424>\
**Category:** Ignition\
**Tags:** perspective, ignition81\
**Created:** [April 22, 2025, 6:32pm UTC](https://forum.inductiveautomation.com/t/perspective-property-change-script-broken-in-ignition-8-1-47/105424 "2025-04-22T18:32:57Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![woodsb02](https://avatars.discourse-cdn.com/v4/letter/w/6a8cbe/32.png) [@woodsb02](https://forum.inductiveautomation.com/u/woodsb02)\
**Post date:** [April 22, 2025, 6:32pm UTC](https://forum.inductiveautomation.com/t/perspective-property-change-script-broken-in-ignition-8-1-47/105424/1 "2025-04-22T18:32:57Z")

</div>

I've noticed that a perspective property change script that used to work in Ignition 8.1.45 is no longer working in release 8.1.47.

The issue can be replicated by creating a brand new project.

**Main View**

Single button that has an onActionPerformed event to open a popup

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/0/d0fe56e4f71cda91b1e56e6c78f37d29189b0cec.png)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/6/969a6c2c8b6b5f1e6e065caed4f532f24848c692.jpeg)

**Popup View**

Single toggle with it's `enabled` property binding to tag `myBoolean`, and the following change script:

```python
def valueChanged(self, previousValue, currentValue, origin, missedEvents):
	if previousValue is not None and previousValue.value and not currentValue.value:
		system.perspective.closePopup("popup0")

```

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/0/10e49b3d8f8b0f45c28b5b5e5bdf63dedc544bb0.png)

The result is that the popup always closes immediately when clicking the button, due to the property change script firing inside the popup, even though the toggle `enabled` value has not changed from true to false. On Ignition version 8.1.45 this did NOT occur.

I note that if I move the tag binding and property change script to the toggle `selected` property (rather than the `enabled` property), the popup does not always close.

I suspect this is related to the following change in the [Ignition 8.1.47 release notes](https://inductiveautomation.com/downloads/releasenotes/8.1.47) - but it's not clear to me if the change in behaviour I am experiencing is deliberate, or how to change my script appropriately.

> _Perspective - Fixed an issue where the previousValue in a Property Change Script would evaluate to None instead of the actual previous value._

---

<div class="post-metadata">

**Author:** ![mhicks1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mhicks1/32/14121_2.png) [@mhicks1](https://forum.inductiveautomation.com/u/mhicks1)\
**Post date:** [April 22, 2025, 6:54pm UTC](https://forum.inductiveautomation.com/t/perspective-property-change-script-broken-in-ignition-8-1-47/105424/2 "2025-04-22T18:54:29Z")

</div>

Hello, It seems your script is missing something. Like you are not comparing correctly. Here is something very similar that works for me when I look at the change of a Bool from 0 to 1. The action falls below the last if and is indented.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/1/4179f2cf75aba13c8f4057376bbdf6ee854d4292.png)

---

<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:** [April 22, 2025, 6:57pm UTC](https://forum.inductiveautomation.com/t/perspective-property-change-script-broken-in-ignition-8-1-47/105424/3 "2025-04-22T18:57:35Z")

</div>

> [@mhicks1](#):
>
> Like you are not comparing correctly.

@woodsb02 is using booleans in comparisons correctly, and more efficiently than your alternative.

If you are using equals or not equals with a boolean value, instead of using the boolean directly, or directly with `not`, you are making your code more fragile and less performant.

---

<div class="post-metadata">

**Author:** ![mhicks1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mhicks1/32/14121_2.png) [@mhicks1](https://forum.inductiveautomation.com/u/mhicks1)\
**Post date:** [April 22, 2025, 7:01pm UTC](https://forum.inductiveautomation.com/t/perspective-property-change-script-broken-in-ignition-8-1-47/105424/4 "2025-04-22T19:01:32Z")

</div>

Learn something new every day. I will have to give that a try. Some of these are from a 7.9 Version that we have carried over to 8.1.44. Thanks for the heads up @pturmel

---

<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:** [April 22, 2025, 7:03pm UTC](https://forum.inductiveautomation.com/t/perspective-property-change-script-broken-in-ignition-8-1-47/105424/5 "2025-04-22T19:03:08Z")

</div>

> [@mhicks1](#):
>
> Some of these are from a 7.9 Version

My general statement is true for all versions of Ignition and all versions of jython and python.

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [April 22, 2025, 7:28pm UTC](https://forum.inductiveautomation.com/t/perspective-property-change-script-broken-in-ignition-8-1-47/105424/6 "2025-04-22T19:28:35Z")

</div>

You might also want to group all your conditions together, if there's no alternative path.  
3 levels of conditions seems excessive.

---

<div class="post-metadata">

**Author:** ![woodsb02](https://avatars.discourse-cdn.com/v4/letter/w/6a8cbe/32.png) [@woodsb02](https://forum.inductiveautomation.com/u/woodsb02)\
**Post date:** [April 24, 2025, 11:36am UTC](https://forum.inductiveautomation.com/t/perspective-property-change-script-broken-in-ignition-8-1-47/105424/7 "2025-04-24T11:36:11Z")

</div>

For anyone experiencing this issue - Inductive Automation support have confirmed this relates to the change I referenced in the 8.1.47 release.

Due to this change, the variables in my script are evaluating as follows when the Perspective view first opens (before the bindings have first read from their tags):

- `previousValue is not None` is True
- `previousValue.value` is True with a quality of Good\_Unspecified
- `currentValue.value` is False with a quality of Good

A workaround is to set the property as [persistent](https://docs.inductiveautomation.com/docs/8.1/ignition-modules/perspective/working-with-perspective-components/perspective-component-properties#persistent-properties) - which ensures the property is initialised to the value configured in Designer when the view was saved. I believe this sets the `previousValue.value` to the persisted value saved in Designer.

I still believe this is not the desired/expected behaviour when `persistent` isn't selected - hence why I referred to the above as a workaround rather than a fix.
