# Way to update a dataset and trigger onCellEdited programtically?

**URL:** <https://forum.inductiveautomation.com/t/way-to-update-a-dataset-and-trigger-oncelledited-programtically/58415>\
**Category:** Ignition\
**Tags:** ignition80\
**Created:** [April 13, 2022, 1:39pm UTC](https://forum.inductiveautomation.com/t/way-to-update-a-dataset-and-trigger-oncelledited-programtically/58415 "2022-04-13T13:39:53Z")\
**Posts on this page:** 3\
**Page:** 1

<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:** [April 13, 2022, 1:39pm UTC](https://forum.inductiveautomation.com/t/way-to-update-a-dataset-and-trigger-oncelledited-programtically/58415/1 "2022-04-13T13:39:53Z")

</div>

I have two tables, one called `DetailedView` which has it’s data bound to a custom property `initialData` which is bound to a named query, and another called `Overview` who’s data property is calculated via expression on the `DetailView`'s data property.

I implemented a lot of logic in the `onCellEdited` extension function of the `Overview` table that modifies the `DetailedView` data. This works nicely, I modify the underlying dataset and `Overview` updates correctly.

Now though I have a few buttons that the user will also take up some of the functionality. I thought via the buttons I would do a `system.dataset.updateRow()` on the `Overview` but I just found out that does not trigger the `onCellEdited` extension function. Is there a way to update the data of a table programatically that does trigger the onCellEdited extension function of the table?

I could make a function, but for some reason power tables use `self` instead of `event.source` so its a bit more work than it would be otherwise hence why I want to first just try to funnel the changes to the already existing `onCellEdited` script.

---

<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 13, 2022, 5:01pm UTC](https://forum.inductiveautomation.com/t/way-to-update-a-dataset-and-trigger-oncelledited-programtically/58415/2 "2022-04-13T17:01:11Z")

</div>

> [@bkarabinchak.psi](#):
>
> I implemented a lot of logic in the `onCellEdited` extension function

This is your mistake. Move the logic to a script module function, taking the parameters you need. I usually use `comp` for the component in question, passing either `self` or `event.source` depending on the calling scope.

---

<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:** [April 13, 2022, 5:14pm UTC](https://forum.inductiveautomation.com/t/way-to-update-a-dataset-and-trigger-oncelledited-programtically/58415/3 "2022-04-13T17:14:08Z")

</div>

Yea I ended up doing by feeding both tables to a function. Originally the spec was just editing the table directly, so cellEdited made sense, then the idea for a few buttons doing it came into being and I ran into this. I got it working. It is a lot of parameters as I need both tables and other info but it works.

But I guess to my question - no it’s not possible to trigger onCellEdited via a script.
