# Column editable does not work in perspective table

**URL:** <https://forum.inductiveautomation.com/t/column-editable-does-not-work-in-perspective-table/93672>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [July 24, 2024, 2:34pm UTC](https://forum.inductiveautomation.com/t/column-editable-does-not-work-in-perspective-table/93672 "2024-07-24T14:34:48Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lina\_Su](https://avatars.discourse-cdn.com/v4/letter/l/7ba0ec/32.png) [@Lina\_Su](https://forum.inductiveautomation.com/u/Lina_Su)\
**Post date:** [July 24, 2024, 2:34pm UTC](https://forum.inductiveautomation.com/t/column-editable-does-not-work-in-perspective-table/93672/1 "2024-07-24T14:34:48Z")

</div>

I created a table in Ignition Perspective with 2 columns and 4 rows. Each column has a name assigned. I want to make the second column editable, so I set the 'editable' property for that column to 'yes'. However, when I open the page in a web browser and try to edit the 'Desp' column, I enter some text and press enter, but the cell reverts to its original value. Did I miss setting up a property correctly?  
 ![test](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/8/589e0488b8902683babf0f945d346edfea80e635.gif)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/5/75602f3225f8a0981a670b2f7016f9d319d5377e.png)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/7/a7ad4213ba3b2efb2614caa3f2f0f0a39535df36.png)

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

---

<div class="post-metadata">

**Author:** ![YF129701](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/yf129701/32/60498_2.png) [@YF129701](https://forum.inductiveautomation.com/u/YF129701)\
**Post date:** [July 24, 2024, 2:42pm UTC](https://forum.inductiveautomation.com/t/column-editable-does-not-work-in-perspective-table/93672/2 "2024-07-24T14:42:07Z")

</div>

You need to use an action on the table (`onCellCommitted` or something like that) to write the new value back to the dataset at columnIndex, rowIndex. Does that make sense?

**EDIT:** Link to the [docs](https://docs.inductiveautomation.com/docs/8.1/appendix/components/perspective-components/perspective-display-palette/perspective-table/perspective-table-scripting#oneditcellcommit):

---

<div class="post-metadata">

**Author:** ![Lina\_Su](https://avatars.discourse-cdn.com/v4/letter/l/7ba0ec/32.png) [@Lina\_Su](https://forum.inductiveautomation.com/u/Lina_Su)\
**Post date:** [July 24, 2024, 2:56pm UTC](https://forum.inductiveautomation.com/t/column-editable-does-not-work-in-perspective-table/93672/3 "2024-07-24T14:56:34Z")

</div>

Is this correct script ?  
But I got error logged.

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

```python
com.inductiveautomation.ignition.common.script.JythonExecException: Traceback (most recent call last): File "", line 3, in runAction TypeError: 'com.inductiveautomation.ignition.common.JsonDataset' object is unsubscriptable

at org.python.core.Py.TypeError(Py.java:234)

at org.python.core.PyObject. __finditem__ (PyObject.java:653)

at org.python.core.PyObjectDerived. __finditem__ (PyObjectDerived.java:920)

at org.python.core.PyObject. __getitem__ (PyObject.java:717)

at org.python.core.PyObjectDerived. __getitem__ (PyObjectDerived.java:960)

at org.python.pycode._pyx5551.runAction$1(:3)

at org.python.pycode._pyx5551.call_function()

at org.python.core.PyTableCode.call(PyTableCode.java:173)

at org.python.core.PyBaseCode.call(PyBaseCode.java:306)

at org.python.core.PyFunction.function ___call__ (PyFunction.java:474)

```

---

<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:** [July 24, 2024, 3:00pm UTC](https://forum.inductiveautomation.com/t/column-editable-does-not-work-in-perspective-table/93672/4 "2024-07-24T15:00:03Z")

</div>

Datasets are immutable. Use the [system.dataset.setValue()](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-dataset/system-dataset-setValue) function to produce a new dataset with the edit, and assign that back to `props.data`.

---

<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:** [July 24, 2024, 3:03pm UTC](https://forum.inductiveautomation.com/t/column-editable-does-not-work-in-perspective-table/93672/5 "2024-07-24T15:03:37Z")

</div>

How did he end up with a `JsonDataset` though ?  
I don't think I've ever seen this before.

---

<div class="post-metadata">

**Author:** ![YF129701](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/yf129701/32/60498_2.png) [@YF129701](https://forum.inductiveautomation.com/u/YF129701)\
**Post date:** [July 24, 2024, 3:05pm UTC](https://forum.inductiveautomation.com/t/column-editable-does-not-work-in-perspective-table/93672/6 "2024-07-24T15:05:22Z")

</div>

> [@Lina\_Su](#):
>
> `Function.function ___call__ (Py`

Precisely what Phil said OR if you had a Query binding on `props.data`, you could set the return type to `JSON` and I believe you would be able to use your script. Right now, it's a Dataset type so you would need to do something like

```python
valueToSet = event.value
newDS = system.dataset.setValue(self.props.data, event.row, event.column, valueToSet)
self.props.data = newDS

```

---

<div class="post-metadata">

**Author:** ![Lina\_Su](https://avatars.discourse-cdn.com/v4/letter/l/7ba0ec/32.png) [@Lina\_Su](https://forum.inductiveautomation.com/u/Lina_Su)\
**Post date:** [July 24, 2024, 3:13pm UTC](https://forum.inductiveautomation.com/t/column-editable-does-not-work-in-perspective-table/93672/7 "2024-07-24T15:13:38Z")

</div>

This works, thanks.
