# Updating cells in a Power Table

**URL:** <https://forum.inductiveautomation.com/t/updating-cells-in-a-power-table/11772>\
**Category:** Ignition\
**Created:** [June 3, 2016, 1:19pm UTC](https://forum.inductiveautomation.com/t/updating-cells-in-a-power-table/11772 "2016-06-03T13:19:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikehill100](https://avatars.discourse-cdn.com/v4/letter/m/bcef8e/32.png) [@mikehill100](https://forum.inductiveautomation.com/u/mikehill100)\
**Post date:** [June 3, 2016, 1:19pm UTC](https://forum.inductiveautomation.com/t/updating-cells-in-a-power-table/11772/1 "2016-06-03T13:19:36Z")

</div>

Hi Everyone!

Looking for a best practice here… I have an onCellEdited script running behind a power table. This script updates a database table. Unfortunately if I click a cell, and then click another cell without entering a number, the script will run and it inserts. Is there a good block for this that anyone has used?

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [June 3, 2016, 2:18pm UTC](https://forum.inductiveautomation.com/t/updating-cells-in-a-power-table/11772/2 "2016-06-03T14:18:23Z")

</div>

Can you use event.oldValue and event.newValue to look for a difference?

I’m not in front of my development machine to check for you. Sorry… ☹

---

<div class="post-metadata">

**Author:** ![mikehill100](https://avatars.discourse-cdn.com/v4/letter/m/bcef8e/32.png) [@mikehill100](https://forum.inductiveautomation.com/u/mikehill100)\
**Post date:** [June 3, 2016, 5:40pm UTC](https://forum.inductiveautomation.com/t/updating-cells-in-a-power-table/11772/3 "2016-06-03T17:40:00Z")

</div>

Yeah. That kinda works for some.

What happens though is that you can also click on a NULL cell and it updates it with a 0…

Sometimes they may want to do this, so I can’t filter for that specific situation.

---

<div class="post-metadata">

**Author:** ![mikehill100](https://avatars.discourse-cdn.com/v4/letter/m/bcef8e/32.png) [@mikehill100](https://forum.inductiveautomation.com/u/mikehill100)\
**Post date:** [June 3, 2016, 5:45pm UTC](https://forum.inductiveautomation.com/t/updating-cells-in-a-power-table/11772/4 "2016-06-03T17:45:02Z")

</div>

Aaah,

Yes it does work.

I was printing them out and it looks like it converted it to a 0 after the inital newVAlue != oldValue check so I think this should work.
