# system.dataset.updateRow -can't be coerced to pyDictionary

**URL:** <https://forum.inductiveautomation.com/t/system-dataset-updaterow-cant-be-coerced-to-pydictionary/31968>\
**Category:** Ignition\
**Created:** [February 5, 2020, 9:26pm UTC](https://forum.inductiveautomation.com/t/system-dataset-updaterow-cant-be-coerced-to-pydictionary/31968 "2020-02-05T21:26:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![csanyia](https://avatars.discourse-cdn.com/v4/letter/c/48db29/32.png) [@csanyia](https://forum.inductiveautomation.com/u/csanyia)\
**Post date:** [February 5, 2020, 9:26pm UTC](https://forum.inductiveautomation.com/t/system-dataset-updaterow-cant-be-coerced-to-pydictionary/31968/1 "2020-02-05T21:26:22Z")

</div>

Trying to update the dataset in a template canvas templates dataset, the system.dataset.addRow worked fine, but the example from the ignition documentation is coming up w/ the following error:

For this example I'm attempting to update the 40th row in the Template Canvas database, there are 9 columns. Code and error below:

> updates = {"9999","rectangle","300","300","300","50","50","n/a","0"}  
> chart = event.source.parent.getComponent("Template Canvas")  
> newPens = system.dataset.updateRow(chart.templates, 40, updates)  
> chart.templates = newPens

Error:

> Traceback (most recent call last):  
> File "event:actionPerformed", line 5, in   
> TypeError: updateRow(): 3rd arg can't be coerced to org.python.core.PyDictionary

---

<div class="post-metadata">

**Author:** ![wking](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/wking/32/21823_2.png) [@wking](https://forum.inductiveautomation.com/u/wking)\
**Post date:** [February 5, 2020, 9:40pm UTC](https://forum.inductiveautomation.com/t/system-dataset-updaterow-cant-be-coerced-to-pydictionary/31968/2 "2020-02-05T21:40:02Z")

</div>

do you need to call system.dataset.toPyDataSet() somewhere?

[https://docs.inductiveautomation.com/display/DOC80/system.dataset.toPyDataSet](https://docs.inductiveautomation.com/display/DOC80/system.dataset.toPyDataSet)

data = system.dataset.toPyDataSet(chart.templates)??

Sorry I don’t know much about the template canvas templates dataset

---

<div class="post-metadata">

**Author:** ![csanyia](https://avatars.discourse-cdn.com/v4/letter/c/48db29/32.png) [@csanyia](https://forum.inductiveautomation.com/u/csanyia)\
**Post date:** [February 5, 2020, 9:49pm UTC](https://forum.inductiveautomation.com/t/system-dataset-updaterow-cant-be-coerced-to-pydictionary/31968/3 "2020-02-05T21:49:44Z")

</div>

I don’t know entirely too much, template canvas dataset appears to just be any normal dataset in ignition.

I followed the documentation for addRow and it works beautifully, but updateRow appears to have some issues. Ill try reading up on toPyDataSet

---

<div class="post-metadata">

**Author:** ![JGJohnson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jgjohnson/32/29582_2.png) [@JGJohnson](https://forum.inductiveautomation.com/u/JGJohnson)\
**Post date:** [February 6, 2020, 1:49pm UTC](https://forum.inductiveautomation.com/t/system-dataset-updaterow-cant-be-coerced-to-pydictionary/31968/4 "2020-02-06T13:49:55Z")

</div>

> [@csanyia](#):
>
> updates = {“9999”,“rectangle”,“300”,“300”,“300”,“50”,“50”,“n/a”,“0”}

This is not a [dictionary](https://www.w3schools.com/python/python_dictionaries.asp). updateRow takes a dictionary as its 3rd parameter where the keys are the column names.

```auto

```
