# onPropertyChange script help - get root container

**URL:** <https://forum.inductiveautomation.com/t/onpropertychange-script-help-get-root-container/78524>\
**Category:** Ignition\
**Created:** [August 29, 2023, 4:44pm UTC](https://forum.inductiveautomation.com/t/onpropertychange-script-help-get-root-container/78524 "2023-08-29T16:44:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Juan\_Caquias](https://avatars.discourse-cdn.com/v4/letter/j/43a26b/32.png) [@Juan\_Caquias](https://forum.inductiveautomation.com/u/Juan_Caquias)\
**Post date:** [August 29, 2023, 4:44pm UTC](https://forum.inductiveautomation.com/t/onpropertychange-script-help-get-root-container/78524/1 "2023-08-29T16:44:11Z")

</div>

Hello,

I feel like this should be a relatively straightforward issue, but I am having a lot of trouble finding the correct way to do this.

I am trying to make an existing window a bit more dynamic. For a bit of context, this window is used for calculating percent of the time that we have run above specific speeds. Right now, those speeds are stored in a dataset as a custom property of the root container (1x3 dataset, "Ranges"). These speeds also appear visually on the interface as labels. I want to change these to numeric inputs, so that a user can edit them, the "Ranges" property is updated, and when the "compute" button is hit, everything references the user-input speeds instead of the current default ranges.

Two problems arise: Actually access the root container custom property within the event handler script, and edit a single value of the dataset.

I started with the first problem, and I feel silly, since I can't seem to find how to do this. I started with event.source.parent.ranges, since I thought that the "parent" of this component was the root container. But this doesn't seem to work. I also tried event.source.getRootContainer().ranges, but I don't think I'm using getRootContainer() properly. Browsing forums and documentation hasn't given the answer yet, and I feel I'm missing something obvious.

Any help would be greatly appreciated.

Once I figure out how to correctly reference the custom property, my next step is modifying one specific cell of the dataset - any reference to the appropriate documentation would also be quite helpful.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [August 29, 2023, 4:50pm UTC](https://forum.inductiveautomation.com/t/onpropertychange-script-help-get-root-container/78524/2 "2023-08-29T16:50:33Z")

</div>

For problem 1:

I would recommend using the property selector in your change scripts -

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/8/38e80dd4d684449c2cc84ed744d5fceb96be8f48.png)

Now just pick what you need and it will make the path for you -

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/e/9e64be089ec40baf117dfaae168dc3b2cc0bbe66.png)

---

<div class="post-metadata">

**Author:** ![Juan\_Caquias](https://avatars.discourse-cdn.com/v4/letter/j/43a26b/32.png) [@Juan\_Caquias](https://forum.inductiveautomation.com/u/Juan_Caquias)\
**Post date:** [August 29, 2023, 5:06pm UTC](https://forum.inductiveautomation.com/t/onpropertychange-script-help-get-root-container/78524/3 "2023-08-29T17:06:41Z")

</div>

Ah, I totally forgot that was a thing! I have been doing other things than ignition lately, and that slipped my mind.

I also was able to solve the other issue by building the dataset in python using system.dataset.toDataSet and inputting the appropriate values.

Thanks!
