# propertyChange triggers without actual change in property

**URL:** <https://forum.inductiveautomation.com/t/propertychange-triggers-without-actual-change-in-property/66786>\
**Category:** Ignition\
**Tags:** vision, ignition81, scripting\
**Created:** [November 22, 2022, 1:00am UTC](https://forum.inductiveautomation.com/t/propertychange-triggers-without-actual-change-in-property/66786 "2022-11-22T01:00:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![PFollansbee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pfollansbee/32/46440_2.png) [@PFollansbee](https://forum.inductiveautomation.com/u/PFollansbee)\
**Post date:** [November 22, 2022, 1:00am UTC](https://forum.inductiveautomation.com/t/propertychange-triggers-without-actual-change-in-property/66786/1 "2022-11-22T01:00:14Z")

</div>

The setup: Using a paintable canvas and having a dataset update based on coordinates. These are rounded to a grid.

The dataset is being evaluated and saved, but the actual values aren't changing. That being said, the propertyChange trigger is still going off. The trigger is appropriately filtered and I sent the dataset to the console. Nothing is actually changing, but it is still being triggered.

I've found a way around it for this instance, but I am wondering... is a propertyChange supposed to trigger when a property is updated (for any reason) or when the property value is actually changed? Is this a bug?

---

<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:** [November 22, 2022, 1:09am UTC](https://forum.inductiveautomation.com/t/propertychange-triggers-without-actual-change-in-property/66786/2 "2022-11-22T01:09:30Z")

</div>

In Java Swing, propertyChange events generally fire for any assignment to a property, even if the value is the same. Note that constructing a dataset with the same content as another yields a new, different dataset (different object ID), even though the content is the same. To avoid an unwanted change event, condition whatever assignment you make to only happen when your definition of "inequality" fits.

---

<div class="post-metadata">

**Author:** ![PFollansbee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pfollansbee/32/46440_2.png) [@PFollansbee](https://forum.inductiveautomation.com/u/PFollansbee)\
**Post date:** [November 22, 2022, 1:36am UTC](https://forum.inductiveautomation.com/t/propertychange-triggers-without-actual-change-in-property/66786/3 "2022-11-22T01:36:28Z")

</div>

Ah, thank you! I just looked at the dataset type in the Java docs, it's a doozy. I didn't realize it contained way more data than the contents. Seems almost like if you want something to fire on a change in a dataset, you need to build a multidim list from the old data and new data then compare those to see if a change occurred. A bit of a pain, but live and learn.

Thanks again!

---

<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:** [November 22, 2022, 1:08pm UTC](https://forum.inductiveautomation.com/t/propertychange-triggers-without-actual-change-in-property/66786/4 "2022-11-22T13:08:02Z")

</div>

Compare to the old data as you construct the new data, maintaining a "difference found" flag as you loop. If true at the end, perform the final build and assignment.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [November 23, 2022, 2:14am UTC](https://forum.inductiveautomation.com/t/propertychange-triggers-without-actual-change-in-property/66786/5 "2022-11-23T02:14:22Z")

</div>

You might be interested in Paul's super cool module with useful extras. There's a function added that compares datasets

> [@Ignition Extensions - Convenience utilities for advanced users](https://forum.inductiveautomation.com/t/ignition-extensions-convenience-utilities-for-advanced-users/64615/48):
>
> 0.6.0 available now: Adds: system.dataset.equals(dataset, dataset): Boolean Returns True if both input datasets have the same columns, with the same types, and the same values. system.dataset.valuesEqual(dataset, dataset): Boolean Returns True if both input datasets have the same number of rows/columns, and those rows/columns have the same values in the same places. system.dataset.columnsEqual(dataset, dataset, ignoreCase=False, includeTypes=True): Boolean Returns True if both inpu…
