# dataset.updateRow

**URL:** <https://forum.inductiveautomation.com/t/dataset-updaterow/6661>\
**Category:** Ignition\
**Created:** [June 6, 2013, 8:43pm UTC](https://forum.inductiveautomation.com/t/dataset-updaterow/6661 "2013-06-06T20:43:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MiddleC](https://avatars.discourse-cdn.com/v4/letter/m/839c29/32.png) [@MiddleC](https://forum.inductiveautomation.com/u/MiddleC)\
**Post date:** [June 6, 2013, 8:43pm UTC](https://forum.inductiveautomation.com/t/dataset-updaterow/6661/1 "2013-06-06T20:43:08Z")

</div>

I’m attempting to modify a table field utilizing a for loop and dataset.updateRow. Essentially code is:

for row in range(table.rowCount):  
custom property = table.getValueAt(row, “field”)  
custom property = table.getValueAt(row, “field”)  
custom property = difference between two custom properties found above  
updates = (‘custom property’: table field)  
newdata = system.dataset.updateRow(table, row, updates)  
getComponent(table) = newdata

I’ve added print statements to verify code is working (e.g. print row, print custom property…), but dataset is never updated.

Is it possible to update a table in this manner?

---

<div class="post-metadata">

**Author:** ![MiddleC](https://avatars.discourse-cdn.com/v4/letter/m/839c29/32.png) [@MiddleC](https://forum.inductiveautomation.com/u/MiddleC)\
**Post date:** [June 7, 2013, 5:22pm UTC](https://forum.inductiveautomation.com/t/dataset-updaterow/6661/2 "2013-06-07T17:22:01Z")

</div>

I found problem with code. Before entering for loop had the following:

table = event.source.parent.getComponent(dataset).data

So, after every updateRow command the original data was written back to dataset newdata.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [June 7, 2013, 5:23pm UTC](https://forum.inductiveautomation.com/t/dataset-updaterow/6661/3 "2013-06-07T17:23:30Z")

</div>

Glad you figured it out. Next time feel free to post the actual code rather than pseudo-code (and use the forums code tags).
