# Null Value in Power Table during Edit

**URL:** <https://forum.inductiveautomation.com/t/null-value-in-power-table-during-edit/11932>\
**Category:** Ignition\
**Created:** [July 15, 2016, 5:32am UTC](https://forum.inductiveautomation.com/t/null-value-in-power-table-during-edit/11932 "2016-07-15T05:32:15Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![bfaivre](https://avatars.discourse-cdn.com/v4/letter/b/f19dbf/32.png) [@bfaivre](https://forum.inductiveautomation.com/u/bfaivre)\
**Post date:** [July 15, 2016, 5:32am UTC](https://forum.inductiveautomation.com/t/null-value-in-power-table-during-edit/11932/1 "2016-07-15T05:32:15Z")

</div>

Hello,

I have a database that I have in a power table with editing on a column enabled. This specific column can accept NULL values in the database. I can’t seem to get this behavior during an edit. For example, if I clear the field out, it forces me to enter a value. I’ve set the number format to “#” for testing purposes - but I am still required to enter a value.

Does anyone know how I can permit my users to set values to database NULL in a power table column w/editable enabled?

Thanks,

Brian

---

<div class="post-metadata">

**Author:** ![KathyApplebaum](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kathyapplebaum/32/7261_2.png) [@KathyApplebaum](https://forum.inductiveautomation.com/u/KathyApplebaum)\
**Post date:** [July 15, 2016, 2:47pm UTC](https://forum.inductiveautomation.com/t/null-value-in-power-table-during-edit/11932/2 "2016-07-15T14:47:35Z")

</div>

> [@](#):
>
> Does anyone know how I can permit my users to set values to database NULL in a power table column w/editable enabled?

Wait until we implement that feature? 😃

We have a ticket for it, it's on the radar for "soonish", but I really don't know how soon that will be. If you want to be notified when it's been done, contact support and have them link you up with the ticket.

---

<div class="post-metadata">

**Author:** ![bfaivre](https://avatars.discourse-cdn.com/v4/letter/b/f19dbf/32.png) [@bfaivre](https://forum.inductiveautomation.com/u/bfaivre)\
**Post date:** [July 16, 2016, 4:50am UTC](https://forum.inductiveautomation.com/t/null-value-in-power-table-during-edit/11932/3 "2016-07-16T04:50:17Z")

</div>

Will do - thank you!

---

<div class="post-metadata">

**Author:** ![Dohertab](https://avatars.discourse-cdn.com/v4/letter/d/e68b1a/32.png) [@Dohertab](https://forum.inductiveautomation.com/u/Dohertab)\
**Post date:** [January 18, 2017, 4:49pm UTC](https://forum.inductiveautomation.com/t/null-value-in-power-table-during-edit/11932/4 "2017-01-18T16:49:18Z")

</div>

Has there been any progress on this? Currently dealing with this issue, thanks!

---

<div class="post-metadata">

**Author:** ![stuart.williams](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/stuart.williams/32/42310_2.png) [@stuart.williams](https://forum.inductiveautomation.com/u/stuart.williams)\
**Post date:** [February 6, 2018, 9:11pm UTC](https://forum.inductiveautomation.com/t/null-value-in-power-table-during-edit/11932/5 "2018-02-06T21:11:03Z")

</div>

Waiting as well…

---

<div class="post-metadata">

**Author:** ![bfuson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bfuson/32/4597_2.png) [@bfuson](https://forum.inductiveautomation.com/u/bfuson)\
**Post date:** [February 7, 2018, 4:44pm UTC](https://forum.inductiveautomation.com/t/null-value-in-power-table-during-edit/11932/6 "2018-02-07T16:44:53Z")

</div>

Why not make the cell type a string?

In your onCellEdit, do something like

```auto
	val = None
	if newValue == None or newValue == "":
		val = 'Null'
	else:
		val = int(newValue)
	query = """ update [table] set [value] = %s """ % val

```

---

<div class="post-metadata">

**Author:** ![paulm1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paulm1/32/5900_2.png) [@paulm1](https://forum.inductiveautomation.com/u/paulm1)\
**Post date:** [August 9, 2018, 12:28am UTC](https://forum.inductiveautomation.com/t/null-value-in-power-table-during-edit/11932/7 "2018-08-09T00:28:04Z")

</div>

> [@KathyApplebaum](#):
>
> Wait until we implement that feature? 😃
> 
> We have a ticket for it, it's on the radar for "soonish", but I really don't know how soon that will be. If you want to be notified when it's been done, contact support and have them link you up with the ticket.

I could sure use this function.

---

<div class="post-metadata">

**Author:** ![paulm1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paulm1/32/5900_2.png) [@paulm1](https://forum.inductiveautomation.com/u/paulm1)\
**Post date:** [August 15, 2018, 4:18pm UTC](https://forum.inductiveautomation.com/t/null-value-in-power-table-during-edit/11932/8 "2018-08-15T16:18:54Z")

</div>

Tech genius Alejandro taught me a work around.  
Using the Scripting Extension Function onPopupTrigger, type in the following script.  
#NULL Entry Popup - Right Click will display Null Popup, Click to Enter Null Value  
def setToNull(evt, cellValue=value):  
ndx = self.data.getValueAt(rowIndex,0)  
query = “UPDATE vdk SET %s = NULL WHERE ndx = ?” % colName  
system.db.runPrepUpdate(query, [ndx])

```
menu = system.gui.createPopupMenu({'Clear':setToNull})
menu.show(event)

```

Work great. Thanks for all the help.

---

<div class="post-metadata">

**Author:** ![lloyd.tripp](https://avatars.discourse-cdn.com/v4/letter/l/a88e4f/32.png) [@lloyd.tripp](https://forum.inductiveautomation.com/u/lloyd.tripp)\
**Post date:** [June 8, 2020, 7:11pm UTC](https://forum.inductiveautomation.com/t/null-value-in-power-table-during-edit/11932/9 "2020-06-08T19:11:58Z")

</div>

Still waiting for this feature to be implemented.

---

<div class="post-metadata">

**Author:** ![Lionel\_Maree](https://avatars.discourse-cdn.com/v4/letter/l/858c86/32.png) [@Lionel\_Maree](https://forum.inductiveautomation.com/u/Lionel_Maree)\
**Post date:** [August 24, 2022, 2:46pm UTC](https://forum.inductiveautomation.com/t/null-value-in-power-table-during-edit/11932/10 "2022-08-24T14:46:47Z")

</div>

Any Feature? XD

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [August 24, 2022, 3:27pm UTC](https://forum.inductiveautomation.com/t/null-value-in-power-table-during-edit/11932/11 "2022-08-24T15:27:36Z")

</div>

Somewhere in the last six years we’ve lost the ticket Kathy mentioned, or at least I can’t find it.

In any event, we’re obviously not treating this as a high priority issue. I would encourage going with the scripting workaround(s) mentioned higher in this thread.

---

<div class="post-metadata">

**Author:** ![Lionel\_Maree](https://avatars.discourse-cdn.com/v4/letter/l/858c86/32.png) [@Lionel\_Maree](https://forum.inductiveautomation.com/u/Lionel_Maree)\
**Post date:** [August 25, 2022, 5:56am UTC](https://forum.inductiveautomation.com/t/null-value-in-power-table-during-edit/11932/12 "2022-08-25T05:56:15Z")

</div>

all good. was just wondering hence the XD face. I did use the workaround and works perfect.
