# How to add a new row in a table in Ignition Perspective

**URL:** <https://forum.inductiveautomation.com/t/how-to-add-a-new-row-in-a-table-in-ignition-perspective/66577>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [November 16, 2022, 10:23am UTC](https://forum.inductiveautomation.com/t/how-to-add-a-new-row-in-a-table-in-ignition-perspective/66577 "2022-11-16T10:23:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Divya\_Chorge1](https://avatars.discourse-cdn.com/v4/letter/d/e19b73/32.png) [@Divya\_Chorge1](https://forum.inductiveautomation.com/u/Divya_Chorge1)\
**Post date:** [November 16, 2022, 10:23am UTC](https://forum.inductiveautomation.com/t/how-to-add-a-new-row-in-a-table-in-ignition-perspective/66577/1 "2022-11-16T10:23:45Z")

</div>

Hello,  
I wanted to add a new row and new data in a table in Ignition Perspective by using Dataset editor.  
I have used "self.props.data[event.row][event.column] = event.value" to edit the table. I am able to edit the table but I am not able to add new row and data in the table.

---

<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:** [November 16, 2022, 10:33am UTC](https://forum.inductiveautomation.com/t/how-to-add-a-new-row-in-a-table-in-ignition-perspective/66577/2 "2022-11-16T10:33:38Z")

</div>

How is your tabled filled (where does the data come from) ?

---

<div class="post-metadata">

**Author:** ![Divya\_Chorge1](https://avatars.discourse-cdn.com/v4/letter/d/e19b73/32.png) [@Divya\_Chorge1](https://forum.inductiveautomation.com/u/Divya_Chorge1)\
**Post date:** [November 16, 2022, 11:17am UTC](https://forum.inductiveautomation.com/t/how-to-add-a-new-row-in-a-table-in-ignition-perspective/66577/3 "2022-11-16T11:17:47Z")

</div>

Data comes through the excel sheet which I have imported the excel sheet in table in Ignition Perspective.

---

<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:** [November 16, 2022, 11:57am UTC](https://forum.inductiveautomation.com/t/how-to-add-a-new-row-in-a-table-in-ignition-perspective/66577/4 "2022-11-16T11:57:10Z")

</div>

So you have a script that imports data from an xls, converts it into a dataset, and assigns it to the table ?

If that's the case, where is that script, what triggers it ?  
What do you want to achieve by adding rows to the table ?

---

<div class="post-metadata">

**Author:** ![Divya\_Chorge1](https://avatars.discourse-cdn.com/v4/letter/d/e19b73/32.png) [@Divya\_Chorge1](https://forum.inductiveautomation.com/u/Divya_Chorge1)\
**Post date:** [November 16, 2022, 12:38pm UTC](https://forum.inductiveautomation.com/t/how-to-add-a-new-row-in-a-table-in-ignition-perspective/66577/5 "2022-11-16T12:38:44Z")

</div>

I am using this below script to add new row in a table, but only blank row is getting added I am not able to enter any values or add any data in a table.

data = self.getSibling("Table").props.data  
newRow =   
data.append(newRow)  
self.getSibling("Table").props.data = 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:** [November 16, 2022, 12:58pm UTC](https://forum.inductiveautomation.com/t/how-to-add-a-new-row-in-a-table-in-ignition-perspective/66577/6 "2022-11-16T12:58:28Z")

</div>

You're not answering the questions...

But don't be surprised that the row in empty if you're appending `[]` to your data. If you want to append data, you need to actually append it...

here's a table:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/5/95e34d7311be6da5459481e9406dd9db02d64d93.png)

A button with this script:

```python
def runAction(self, event):
	new_row = {'value': 10, 'square': 10*10}
	self.getSibling("Table_1").props.data.append(new_row)

```

correctly adds a row with `10` and `100`:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/b/dbc929d953b31c7575a4640c79155f49c97af87b.png)
