# Editing a Dataset TAG memory element by element

**URL:** <https://forum.inductiveautomation.com/t/editing-a-dataset-tag-memory-element-by-element/18524>\
**Category:** Ignition\
**Created:** [June 19, 2018, 8:15am UTC](https://forum.inductiveautomation.com/t/editing-a-dataset-tag-memory-element-by-element/18524 "2018-06-19T08:15:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![diego.navarro](https://avatars.discourse-cdn.com/v4/letter/d/46a35a/32.png) [@diego.navarro](https://forum.inductiveautomation.com/u/diego.navarro)\
**Post date:** [June 19, 2018, 8:15am UTC](https://forum.inductiveautomation.com/t/editing-a-dataset-tag-memory-element-by-element/18524/1 "2018-06-19T08:15:03Z")

</div>

I am trying to edit a Dataset created as a TAG Memory, I am using next script and I get not errors when it is executed, but the dataset “MT1/Resultados/Datos” is not updated with new values.

table = system.tag.read(“MT1/Resultados/Datos”)  
while a \<=10:  
source = ‘Puerta/Datos/Tiempo/’+ str(a)  
tiempo = system.tag.read(source).value  
newData = system.dataset.setValue(table.value, a, “Tiempo”, tiempo)  
print newData.getValueAt(a, 0)  
estado = system.tag.write(“MT1/Resultados/Datos”,newData)  
print estado

---

<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:** [June 19, 2018, 12:36pm UTC](https://forum.inductiveautomation.com/t/editing-a-dataset-tag-memory-element-by-element/18524/2 "2018-06-19T12:36:51Z")

</div>

Please edit your post to include the code formatting markers – your indentation is not visible, and that is important to read your code. Use triple-backquotes (like so: ```) on a lines by themselves above and below your code. That said, I suspect that part of your problem is the lack of any increment for ‘`a`’, making the loop run forever.
