# Table , deleting multiple rows

**URL:** <https://forum.inductiveautomation.com/t/table-deleting-multiple-rows/4174>\
**Category:** Ignition\
**Created:** [March 19, 2012, 8:17pm UTC](https://forum.inductiveautomation.com/t/table-deleting-multiple-rows/4174 "2012-03-19T20:17:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Curlyandshemp](https://avatars.discourse-cdn.com/v4/letter/c/bcef8e/32.png) [@Curlyandshemp](https://forum.inductiveautomation.com/u/Curlyandshemp)\
**Post date:** [March 19, 2012, 8:17pm UTC](https://forum.inductiveautomation.com/t/table-deleting-multiple-rows/4174/1 "2012-03-19T20:17:30Z")

</div>

Forgive me, I have blown out my Advance course gateway backup and am now trying to recall from memory several cool things we learned.

One in particular I am looking for an example of is the delection of several selected rows in a table.

I know in scripting there will be a for loop based on the number rows selected.  
I just can’t recall the code to get the number of rows selected

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:** [March 19, 2012, 11:48pm UTC](https://forum.inductiveautomation.com/t/table-deleting-multiple-rows/4174/2 "2012-03-19T23:48:00Z")

</div>

Here you go:`table = event.source.parent.getComponent("Table")
data = table.data
selectedRows = table.getSelectedRows()
for row in selectedRows:
    id = data.getValueAt(row, "id")
    system.db.runPrepUpdate("DELETE FROM Table WHERE ID = ?", [id])
    ......`Hope that helps.

---

<div class="post-metadata">

**Author:** ![Curlyandshemp](https://avatars.discourse-cdn.com/v4/letter/c/bcef8e/32.png) [@Curlyandshemp](https://forum.inductiveautomation.com/u/Curlyandshemp)\
**Post date:** [March 20, 2012, 1:43pm UTC](https://forum.inductiveautomation.com/t/table-deleting-multiple-rows/4174/3 "2012-03-20T13:43:20Z")

</div>

Once again, thanks Travis.

Is there a refrence list of all these object goodies such as \*.getselectedrows() ? I have been looking through the online documentation and cannot find anything

---

<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:** [March 20, 2012, 3:38pm UTC](https://forum.inductiveautomation.com/t/table-deleting-multiple-rows/4174/4 "2012-03-20T15:38:58Z")

</div>

Yes, this one exists in Appendix A for the table component:

[inductiveautomation.com/supp … itable.htm](http://www.inductiveautomation.com/support/usermanuals/ignition/tables_pmitable.htm)
