# Table Component - Cell editing

**URL:** <https://forum.inductiveautomation.com/t/table-component-cell-editing/112541>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [December 1, 2025, 7:29pm UTC](https://forum.inductiveautomation.com/t/table-component-cell-editing/112541 "2025-12-01T19:29:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rdbcervantes5](https://avatars.discourse-cdn.com/v4/letter/r/e19adc/32.png) [@rdbcervantes5](https://forum.inductiveautomation.com/u/rdbcervantes5)\
**Post date:** [December 1, 2025, 7:29pm UTC](https://forum.inductiveautomation.com/t/table-component-cell-editing/112541/1 "2025-12-01T19:29:53Z")

</div>

I am trying to have a table display a table from database. With the table component in perspective i should be able to edit cells and then press a button to commit the changes I made to the database. However, my table is editable, I am able to edit the number but as soon as press enter to confirm my edit or click out of the cell it reverts back to the previous value. I will attach screenshots with the current setup. Hoping someone has ran into the same issue and has a solution.

Table setup:

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

Table populates from startup script

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/8/d8ce894832635b5e35556d841a567af99adb5fce.png)

Startup Script:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/3/238b3b97d8421b5bb83d48e0106a689c6cb06658.png)

Worth noting that if i change the values in the property editor, on props, it changes my table correctly.

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [December 1, 2025, 7:33pm UTC](https://forum.inductiveautomation.com/t/table-component-cell-editing/112541/2 "2025-12-01T19:33:02Z")

</div>

You need to configure your `onCellEditCommit` event script on the table to write the data back to the table and/or the data source for the table. If your script only writes to the original data source (db) you'll need to remember to pull the new data into the table.

> **[Perspective - Table Scripting | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/appendix/components/perspective-components/perspective-display-palette/perspective-table/perspective-table-scripting#oneditcellcommit)**
>
> This page details the various scripting, component, and extension functions available for Perspective's Table component.

Also, screenshots are great for context, but please also post copies of code as preformatted text. It helps to speed up the troubleshooting process by others. Please see [Wiki - how to post code on this forum](https://forum.inductiveautomation.com/t/wiki-how-to-post-code-on-this-forum/77831).

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [December 1, 2025, 7:37pm UTC](https://forum.inductiveautomation.com/t/table-component-cell-editing/112541/3 "2025-12-01T19:37:10Z")

</div>

Welcome to the forum.

First, I would bind the query to the data property and not use a startup script. When you edit a data source like this, you have to implement a database update to write the change back to the database; otherwise, it will continue to "rollback" since the source is not being edited.

I usually create a custom property that the edit cell event adds an entry with the primary key of the row edited, the field name that was edited, and the new value. Then when you commit the edits, you grab the changes list, loop through it, and run `system.db.runPrepUpdate()` to update the DB.

This would be best as a library script where logging and auditing can be added as well. You might consider wrapping it up in a DB transaction so the changes can be rolled back on any update errors.
