# Table Functions?

**URL:** <https://forum.inductiveautomation.com/t/table-functions/3438>\
**Category:** Ignition\
**Created:** [October 14, 2011, 9:17pm UTC](https://forum.inductiveautomation.com/t/table-functions/3438 "2011-10-14T21:17:29Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![scott\_rister](https://avatars.discourse-cdn.com/v4/letter/s/5daacb/32.png) [@scott\_rister](https://forum.inductiveautomation.com/u/scott_rister)\
**Post date:** [October 14, 2011, 9:17pm UTC](https://forum.inductiveautomation.com/t/table-functions/3438/1 "2011-10-14T21:17:29Z")

</div>

i was looking at the help for the Table component in the User’s Manaul and noticed it lists many functions for editing the table. Ex., AddRow(), DeleteRow(), UpdateRow(), etc.  
Unfotunately I am unable to make them work.  
How are these used from a button outside the table? How is the table referenced?  
Thanks in advance,  
Scott

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [October 14, 2011, 9:20pm UTC](https://forum.inductiveautomation.com/t/table-functions/3438/2 "2011-10-14T21:20:46Z")

</div>

From a button outside of the table do the following:[code]table = event.source.parent.getComponent(“Table”)  
table.addRow([col1, col2, col3, …])

# or another function like exporting

table.exportCSV(“table.csv”, 1)[/code]Hope that helps

---

<div class="post-metadata">

**Author:** ![scott\_rister](https://avatars.discourse-cdn.com/v4/letter/s/5daacb/32.png) [@scott\_rister](https://forum.inductiveautomation.com/u/scott_rister)\
**Post date:** [October 18, 2011, 8:52pm UTC](https://forum.inductiveautomation.com/t/table-functions/3438/3 "2011-10-18T20:52:34Z")

</div>

Can you tell me how to get the value of a selected cell?  
I need to be able to select a row of a table and then get the values of the columns in the selected row.  
i see .SetValue which allows for setting a cell vallue indicated by row and column. is there an equivalent to Get the value?  
Thanks,

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [October 18, 2011, 9:05pm UTC](https://forum.inductiveautomation.com/t/table-functions/3438/4 "2011-10-18T21:05:47Z")

</div>

You can do the following:`table = event.source.parent.getComponent("Table")
data = table.data
selectedRow = table.selectedRow
if selectedRow != -1:
    value = data.getValueAt(selectedRow, "ColumnName")`

---

<div class="post-metadata">

**Author:** ![scott\_rister](https://avatars.discourse-cdn.com/v4/letter/s/5daacb/32.png) [@scott\_rister](https://forum.inductiveautomation.com/u/scott_rister)\
**Post date:** [October 18, 2011, 9:26pm UTC](https://forum.inductiveautomation.com/t/table-functions/3438/5 "2011-10-18T21:26:50Z")

</div>

Thanks so much. This is perfect.  
Where should I have found the .getValueAt function?  
is exactly what i was looking for but couldn’t manage to find it.

---

<div class="post-metadata">

**Author:** ![Greg.Buehler](https://avatars.discourse-cdn.com/v4/letter/g/ecc23a/32.png) [@Greg.Buehler](https://forum.inductiveautomation.com/u/Greg.Buehler)\
**Post date:** [October 18, 2011, 9:36pm UTC](https://forum.inductiveautomation.com/t/table-functions/3438/6 "2011-10-18T21:36:22Z")

</div>

It’s in the help file under Scripting-\>Python-\>Python in Ignition-\>Working with Different Datatypes
