# Table component in vision

**URL:** <https://forum.inductiveautomation.com/t/table-component-in-vision/78145>\
**Category:** Ignition\
**Tags:** ignition81, vision, scripting\
**Created:** [August 21, 2023, 10:03am UTC](https://forum.inductiveautomation.com/t/table-component-in-vision/78145 "2023-08-21T10:03:23Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Surya\_Chandra\_Mohan](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@Surya\_Chandra\_Mohan](https://forum.inductiveautomation.com/u/Surya_Chandra_Mohan)\
**Post date:** [August 21, 2023, 10:03am UTC](https://forum.inductiveautomation.com/t/table-component-in-vision/78145/1 "2023-08-21T10:03:23Z")

</div>

Hello,  
I have a table component in vision and I have used named queries to get the values from database and update in vision table  
I am able to add values in the respective vision table but it is not reflecting in the database

Can you please me out with this issue?

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [August 21, 2023, 11:54am UTC](https://forum.inductiveautomation.com/t/table-component-in-vision/78145/2 "2023-08-21T11:54:08Z")

</div>

You need to somehow trigger an update to the database. Depending on your needs there are several ways to accomplish that.

Are you using the standard Table component or the Power Table component?

Probably the easiest way to accomplish this is the following (assuming you're using the standard table), is to add a `cellEdited` script to the table. You can either use the `SQL Update` tab or you can use the `Script Editor` tab and call `system.db.runNamedQuery()` to run an update query against the database.

---

<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:** [August 21, 2023, 1:05pm UTC](https://forum.inductiveautomation.com/t/table-component-in-vision/78145/3 "2023-08-21T13:05:26Z")

</div>

> [@Surya\_Chandra\_Mohan](#):
>
> but it is not reflecting in the database

Just to clarify what @lrose is saying: Ignition doesn't edit database tables for you. If you edit a table in your UI, **you** are responsible for updating the database with appropriate SQL. Ignition provides **events** that you can react to in order to do so.

You can also wait until all edits are done, and use a "save" button to go through your edited table content and push the changes to the DB. (Usually need to keep an unmodified copy of the dataset handy for comparison.)

---

<div class="post-metadata">

**Author:** ![Surya\_Chandra\_Mohan](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@Surya\_Chandra\_Mohan](https://forum.inductiveautomation.com/u/Surya_Chandra_Mohan)\
**Post date:** [August 22, 2023, 5:44am UTC](https://forum.inductiveautomation.com/t/table-component-in-vision/78145/4 "2023-08-22T05:44:29Z")

</div>

![2023-08-22 (4)](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/3/b38d8a32c870a0e0214fe26c95b0f888a4add110.png)

This is the script which I have written for adding a new record in the table  
It is not updating in the database and once I close and open the project, the record will be deleted

---

<div class="post-metadata">

**Author:** ![Priyanka.Khandge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/priyanka.khandge/32/35989_2.png) [@Priyanka.Khandge](https://forum.inductiveautomation.com/u/Priyanka.Khandge)\
**Post date:** [August 22, 2023, 9:58am UTC](https://forum.inductiveautomation.com/t/table-component-in-vision/78145/5 "2023-08-22T09:58:36Z")

</div>

@Surya_Chandra_Mohan refer below link

[https://forum.inductiveautomation.com/t/add-row-to-table-in-sql-database/10395/2?u=priyanka.khandge](https://forum.inductiveautomation.com/t/add-row-to-table-in-sql-database/10395/2)

---

<div class="post-metadata">

**Author:** ![Surya\_Chandra\_Mohan](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@Surya\_Chandra\_Mohan](https://forum.inductiveautomation.com/u/Surya_Chandra_Mohan)\
**Post date:** [August 22, 2023, 12:06pm UTC](https://forum.inductiveautomation.com/t/table-component-in-vision/78145/6 "2023-08-22T12:06:26Z")

</div>

Thanks everyone! Appreciate it!
