# updateRow not updated my table dataset

**URL:** <https://forum.inductiveautomation.com/t/updaterow-not-updated-my-table-dataset/905>\
**Category:** Archived Topics\
**Created:** [December 23, 2008, 11:43pm UTC](https://forum.inductiveautomation.com/t/updaterow-not-updated-my-table-dataset/905 "2008-12-23T23:43:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jonathan](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@Jonathan](https://forum.inductiveautomation.com/u/Jonathan)\
**Post date:** [December 23, 2008, 11:43pm UTC](https://forum.inductiveautomation.com/t/updaterow-not-updated-my-table-dataset/905/1 "2008-12-23T23:43:19Z")

</div>

```auto
newValue = event.newValue
oldValue = event.oldValue
row = event.row
column = event.column

if(newValue == "pre" or newValue == "post"):
	fpmi.db.runPrepStmt("UPDATE tblMaltDataSNB SET TestType = ? WHERE MALTSNBID = ?",[newValue, intMALTSNBID])
else:
	dictTestType = {"TestType":oldValue}
	fpmi.dataset.updateRow(event.source.data, row, dictTestType)
	fpmi.gui.warningBox('The test type can only be "pre" or "post".')
```

I have this code on the cellEdited event of a table. I would like the cell of the dataset to revert back to the old value if the new value is not equal to the strings “pre” or “post”

I do not receive any errors when this code fires, but the cell of the dataset does not revert back either.

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [December 24, 2008, 12:09am UTC](https://forum.inductiveautomation.com/t/updaterow-not-updated-my-table-dataset/905/2 "2008-12-24T00:09:22Z")

</div>

Your second to last line (the call to fpmi.dataset.updateRow) isn’t doing anything useful. It is taking the table’s dataset, making a new dataset with the updated row, and returning it, but you’re not doing anything with the return value. Simply change the second to last line to be :

```auto
   event.source.data = fpmi.dataset.updateRow(event.source.data, row, dictTestType)
```

Hope this helps,
