# Editing a Table with Dataset Data - Scripting Error

**URL:** <https://forum.inductiveautomation.com/t/editing-a-table-with-dataset-data-scripting-error/84732>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [January 24, 2024, 8:50pm UTC](https://forum.inductiveautomation.com/t/editing-a-table-with-dataset-data-scripting-error/84732 "2024-01-24T20:50:43Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![zzTSH](https://avatars.discourse-cdn.com/v4/letter/z/da6949/32.png) [@zzTSH](https://forum.inductiveautomation.com/u/zzTSH)\
**Post date:** [January 24, 2024, 8:50pm UTC](https://forum.inductiveautomation.com/t/editing-a-table-with-dataset-data-scripting-error/84732/1 "2024-01-24T20:50:43Z")

</div>

Hey  
I have a table that is linked to a memory tag with a value "Dataset[7R x 2C]"  
This is how the data looks:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/0/b05fc04111d2426417907fda1d9b449250c92856.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/c/fc85d740463610ddb71cd8306066c7d1e00f74f6.png)

I would like have the user be able to click the "Target" column, add a number.

I have added an event based off this guide:

[![](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/f/1f6e47e718aaf712d8e359990421cce788808438.jpeg "How to edit table columns in Perspective - Ignition by Inductive Automation") ](https://www.youtube.com/watch?v=wiHMzrWvk_g)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/b/ebb8d228d16ca089d7f769541dbd38e9b5d617a0.png)

This is the error I am getting:

```auto
Error running action 'component.onEditCellCommit' on site-views/production/production-setup@D/root/Table_0: Traceback (most recent call last): File "<function:runAction>", line 2, in runAction TypeError: 'com.inductiveautomation.ignition.common.BasicDataset' object is unsubscriptable

```

I have tried this method on the default table that you can drag in from the components pallet & it does work, so this makes me think that doing this with the dataset linked to the data prop is the issue.

How can I solve this problem - I did search the docs and did not find anything so if documentation does exist, apologies, please point me in the right direction

Thanks

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [January 24, 2024, 9:45pm UTC](https://forum.inductiveautomation.com/t/editing-a-table-with-dataset-data-scripting-error/84732/2 "2024-01-24T21:45:21Z")

</div>

It works on the default table because the data is in a JSON format, while you're specified your data is a DataSet. DataSets are indeed unsubscriptable in this manner, and I believe they are also immutable.

Assuming you are reading this data from a tag with a path of `[default]ABC/XYZ`, try [this](https://docs.inductiveautomation.com/display/DOC81/system.dataset.setValue):

```python
def runAction(self.event):
    # be wary of whitespace differences when copying code from the forums
    tagPath = "[default]ABC/XYZ"
    updatedDataset = system.dataset.setValue(self.props.data, event.row, event.column, event.value)
    system.tag.writeBlocking([tagPath], [updatedDataset])

```

---

<div class="post-metadata">

**Author:** ![zzTSH](https://avatars.discourse-cdn.com/v4/letter/z/da6949/32.png) [@zzTSH](https://forum.inductiveautomation.com/u/zzTSH)\
**Post date:** [January 24, 2024, 10:05pm UTC](https://forum.inductiveautomation.com/t/editing-a-table-with-dataset-data-scripting-error/84732/3 "2024-01-24T22:05:26Z")

</div>

Hi Cmallonee,

Thanks, this worked!

So I can help myself in the future - Where would I find more information about these functions that you listed

- system.tag.writeBlocking([tagPath], [updatedDataset])
- system.dataset.setValue(self.props.data, event.row, event.column, event.value)

Is there some documentation that explains these functions?

Also - It would be good if the Table Documentation had an example of how todo this too

Thanks!

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [January 24, 2024, 10:08pm UTC](https://forum.inductiveautomation.com/t/editing-a-table-with-dataset-data-scripting-error/84732/4 "2024-01-24T22:08:08Z")

</div>

My previous post included a link to the [setValue](https://docs.inductiveautomation.com/display/DOC81/system.dataset.setValue) function. I highly recommend you familiarize yourself with the [Manual](https://docs.inductiveautomation.com/display/DOC81/Welcome) before you continue further.

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [January 24, 2024, 10:09pm UTC](https://forum.inductiveautomation.com/t/editing-a-table-with-dataset-data-scripting-error/84732/5 "2024-01-24T22:09:38Z")

</div>

The System Functions toward the bottom of the left-hand navigation is where most of my knowledge comes from.

---

<div class="post-metadata">

**Author:** ![zzTSH](https://avatars.discourse-cdn.com/v4/letter/z/da6949/32.png) [@zzTSH](https://forum.inductiveautomation.com/u/zzTSH)\
**Post date:** [January 26, 2024, 7:20am UTC](https://forum.inductiveautomation.com/t/editing-a-table-with-dataset-data-scripting-error/84732/6 "2024-01-26T07:20:51Z")

</div>

Is this method listed anywhere in the docs? or am i just ment to know how todo this?

Seems like it would be something that a lot of people would use.

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [January 26, 2024, 10:11am UTC](https://forum.inductiveautomation.com/t/editing-a-table-with-dataset-data-scripting-error/84732/7 "2024-01-26T10:11:16Z")

</div>

It's in the dataset's doc:

[https://docs.inductiveautomation.com/display/DOC81/Datasets#Datasets-AlteringaDataset](https://docs.inductiveautomation.com/display/DOC81/Datasets#Datasets-AlteringaDataset)
