# Perspective table delete row script woe

**URL:** <https://forum.inductiveautomation.com/t/perspective-table-delete-row-script-woe/43112>\
**Category:** Ignition\
**Created:** [February 7, 2021, 6:02pm UTC](https://forum.inductiveautomation.com/t/perspective-table-delete-row-script-woe/43112 "2021-02-07T18:02:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [February 7, 2021, 6:02pm UTC](https://forum.inductiveautomation.com/t/perspective-table-delete-row-script-woe/43112/1 "2021-02-07T18:02:57Z")

</div>

I can’t find an example of a _Perspective_ table with Add and Delete row buttons so I’m rolling my own (with great difficulty).

```auto
Root
- FlexContainer
  - btnDeleteRow
- Table

```

The _btnDeleteRow_ _onActionPerformed_ script is

```auto
	try:
		params = {'id':self.parent.parent.getChild("Table").props.selection.data[0].id}
		system.db.runNamedQuery('Config/queryConfigRowDelete', params)
		self.parent.parent.getChild("Table").refreshBinding(‘props.data’)
	except:
		pass	

```

The table binding is to a named query, type = Update Query, with command

```auto
DELETE FROM myTable WHERE id = :id

```

The output console reports the following. (Line breaks mine for legibility.)

```auto
ERROR com.inductiveautomation.ignition.client.util.gui.
    ErrorUtil - Unable to run action 'component.onActionPerformed' on subViews/viewConfig@D/root/FlexContainer/btnDeleteRow: 
    code could not be compiled.
com.inductiveautomation.ignition.common.GenericTransferrableException: 
    SyntaxError: (u"no viable alternative at character '\u2018'", ('<function:runAction>', 7, 54, 
     u'\t\tself.parent.parent.getChild("Table").refreshBinding(\u2018props.data\u2019)\n'))

```

Can anyone see what I can’t?

Many thanks. Oh - and is there an example Add / Delete table row anywhere?

---

<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:** [February 7, 2021, 7:03pm UTC](https://forum.inductiveautomation.com/t/perspective-table-delete-row-script-woe/43112/2 "2021-02-07T19:03:08Z")

</div>

Line 7, character 54 is a unicode tilted quote character instead a proper quote.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [February 7, 2021, 8:34pm UTC](https://forum.inductiveautomation.com/t/perspective-table-delete-row-script-woe/43112/3 "2021-02-07T20:34:46Z")

</div>

What a guy! You are correct.  
It must have come in on a copy-n-paste from either the manual or this forum.  
Delete button is working. On to the Add button now.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [February 8, 2021, 5:43pm UTC](https://forum.inductiveautomation.com/t/perspective-table-delete-row-script-woe/43112/4 "2021-02-08T17:43:30Z")

</div>

It’s not ready for an Exchange resource yet, but here’s a WIP “CRUD” (create-read-update-delete) dataset editor I’m working on in Perspective, if you want some inspiration:  
[crudTable.zip](https://forum.inductiveautomation.com/uploads/short-url/qGml4f0SPyWM9QFKxHHTl5pIKqA.zip) (16.8 KB)

---

<div class="post-metadata">

**Author:** ![sharmila.belvalkar](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sharmila.belvalkar/32/30067_2.png) [@sharmila.belvalkar](https://forum.inductiveautomation.com/u/sharmila.belvalkar)\
**Post date:** [December 6, 2021, 2:30pm UTC](https://forum.inductiveautomation.com/t/perspective-table-delete-row-script-woe/43112/5 "2021-12-06T14:30:47Z")

</div>

@PGriffith , is it available on Exchange now?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [December 6, 2021, 3:15pm UTC](https://forum.inductiveautomation.com/t/perspective-table-delete-row-script-woe/43112/6 "2021-12-06T15:15:55Z")

</div>

No, I never continued working on it much longer and no longer have it. You can use the project export there, and feel free to post it to the exchange if you do end up improving it.
