# Table toggle switch

**URL:** <https://forum.inductiveautomation.com/t/table-toggle-switch/64986>\
**Category:** Ignition\
**Created:** [October 9, 2022, 6:34pm UTC](https://forum.inductiveautomation.com/t/table-toggle-switch/64986 "2022-10-09T18:34:23Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tim\_Hansson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/tim_hansson/32/39365_2.png) [@Tim\_Hansson](https://forum.inductiveautomation.com/u/Tim_Hansson)\
**Post date:** [October 9, 2022, 6:34pm UTC](https://forum.inductiveautomation.com/t/table-toggle-switch/64986/1 "2022-10-09T18:34:23Z")

</div>

Hi,  
New to Ignition and using Ignition maker. In the designer I have placed a table with 3 columns. Two columns have boolean tags and I want to use the toogle switch. The table is showing toggles and in correct state according to the boolean tags. However I can't manipulate them although the binding is "bidirectional". I can double click and select the cell and manipulate it but it won't save. I have created a single toggle switch on the same tag and it's working so must be doing something wrong with the table settings

---

<div class="post-metadata">

**Author:** ![gdube](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/gdube/32/41701_2.png) [@gdube](https://forum.inductiveautomation.com/u/gdube)\
**Post date:** [October 9, 2022, 6:43pm UTC](https://forum.inductiveautomation.com/t/table-toggle-switch/64986/2 "2022-10-09T18:43:32Z")

</div>

Did you implement the "onCellEdited" event on the table?

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

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [October 9, 2022, 7:41pm UTC](https://forum.inductiveautomation.com/t/table-toggle-switch/64986/3 "2022-10-09T19:41:52Z")

</div>

Toggling the switches of the table is manipulating the (local) data of the Table, but it does not write-back to the (remote) data from the binding. The preceding example should work if there is a bidirectional binding in place on `Table.props.data`. If there is not, then the code would only temporarily replace the data local to the table, and would not write back to the remote data.

---

<div class="post-metadata">

**Author:** ![Tim\_Hansson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/tim_hansson/32/39365_2.png) [@Tim\_Hansson](https://forum.inductiveautomation.com/u/Tim_Hansson)\
**Post date:** [October 9, 2022, 8:19pm UTC](https://forum.inductiveautomation.com/t/table-toggle-switch/64986/4 "2022-10-09T20:19:44Z")

</div>

I can't find that on the table event. I have right clicked in the table and then events.  
I have ignition maker so having Ignition designer and Perspective components if that makes any diffrent?

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [October 9, 2022, 11:43pm UTC](https://forum.inductiveautomation.com/t/table-toggle-switch/64986/5 "2022-10-09T23:43:19Z")

</div>

The onCellEdited example is Vision, so it won't be applicable to perspective.

As noted by @cmallonee, this is what you need:

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

If that isn't enough, perhaps show us your table, scripting, and prop settings, so we can dig deeper into the problem

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [October 10, 2022, 12:27am UTC](https://forum.inductiveautomation.com/t/table-toggle-switch/64986/6 "2022-10-10T00:27:08Z")

</div>

Here are a couple of other things you can check:  
Column prop set to editable:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/a/0a34b3c09b12cdb066e0512a301a46fd68558225.png)

Update script correct in onEditCellCommit event script:

```auto
def runAction(self, event):
	self.props.data = system.dataset.setValue(self.props.data, event.row, event.column, event.value)

```

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/1/01fb69746545634bc17716e71ef7112556335a20.png)

---

<div class="post-metadata">

**Author:** ![Tim\_Hansson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/tim_hansson/32/39365_2.png) [@Tim\_Hansson](https://forum.inductiveautomation.com/u/Tim_Hansson)\
**Post date:** [October 10, 2022, 7:09pm UTC](https://forum.inductiveautomation.com/t/table-toggle-switch/64986/7 "2022-10-10T19:09:49Z")

</div>

I have tried all of the solutions above but with no luck.

 ![1](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/b/3bb5164d236629dffc48f036e349ea7d744a0faa.png)  
 ![2](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/7/e777a3a898a9f94cb02ef5b36f83bbe169c4fe58.png)

---

<div class="post-metadata">

**Author:** ![Arnaud\_Declerck](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/arnaud_declerck/32/44872_2.png) [@Arnaud\_Declerck](https://forum.inductiveautomation.com/u/Arnaud_Declerck)\
**Post date:** [October 10, 2022, 7:43pm UTC](https://forum.inductiveautomation.com/t/table-toggle-switch/64986/8 "2022-10-10T19:43:17Z")

</div>

Hi @Tim_Hansson,

 ![Capture d’écran 2022-10-10 à 21.40.56](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/4/44fa6c03b29dafe02f0bf0a4792b1015be09dfb9.png)

This worked for me.

Here you can find a export of the view with a test table.  
[test\_2022-10-10\_2141.zip](https://forum.inductiveautomation.com/uploads/short-url/aFgPGUu93OGir4JFSyKVDThCuUT.zip) (4.9 KB)

Regards

Arnaud

---

<div class="post-metadata">

**Author:** ![Tim\_Hansson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/tim_hansson/32/39365_2.png) [@Tim\_Hansson](https://forum.inductiveautomation.com/u/Tim_Hansson)\
**Post date:** [October 10, 2022, 7:46pm UTC](https://forum.inductiveautomation.com/t/table-toggle-switch/64986/9 "2022-10-10T19:46:15Z")

</div>

That did the trick, thanks!

---

<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:** [October 10, 2022, 7:51pm UTC](https://forum.inductiveautomation.com/t/table-toggle-switch/64986/10 "2022-10-10T19:51:26Z")

</div>

Just as a note. As mentioned, if you have a binding on your data property to load data from some other source, then this will only temporarily modify the data (until the binding refreshes). You need to insure that you are modifying the source of the data with the new values, then let the binding update the data property. This can be done with either a bi-directional binding or with a scripting method such as `system.db.runNamedQuery()`

If the table is the source of the data, then you're fine, if it isn't eventually you will loose your changes.

---

<div class="post-metadata">

**Author:** ![Tim\_Hansson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/tim_hansson/32/39365_2.png) [@Tim\_Hansson](https://forum.inductiveautomation.com/u/Tim_Hansson)\
**Post date:** [October 23, 2022, 6:22pm UTC](https://forum.inductiveautomation.com/t/table-toggle-switch/64986/11 "2022-10-23T18:22:39Z")

</div>

Hi, I have a new problem with this. I've added the table to a tab container. And now it doesn't work anymore as before?

---

<div class="post-metadata">

**Author:** ![Arnaud\_Declerck](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/arnaud_declerck/32/44872_2.png) [@Arnaud\_Declerck](https://forum.inductiveautomation.com/u/Arnaud_Declerck)\
**Post date:** [October 23, 2022, 6:31pm UTC](https://forum.inductiveautomation.com/t/table-toggle-switch/64986/12 "2022-10-23T18:31:43Z")

</div>

can you send a little be more info, view structure, scripts, print screen.

---

<div class="post-metadata">

**Author:** ![Tim\_Hansson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/tim_hansson/32/39365_2.png) [@Tim\_Hansson](https://forum.inductiveautomation.com/u/Tim_Hansson)\
**Post date:** [October 23, 2022, 6:44pm UTC](https://forum.inductiveautomation.com/t/table-toggle-switch/64986/13 "2022-10-23T18:44:48Z")

</div>

I copied the table in the tab, to outside of the tab, and now that doesn't work either 😕

 ![Toggle](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/8/8893ef86f3674386d2c0ecd1138c786f72c02753.png)

---

<div class="post-metadata">

**Author:** ![Arnaud\_Declerck](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/arnaud_declerck/32/44872_2.png) [@Arnaud\_Declerck](https://forum.inductiveautomation.com/u/Arnaud_Declerck)\
**Post date:** [October 23, 2022, 7:02pm UTC](https://forum.inductiveautomation.com/t/table-toggle-switch/64986/14 "2022-10-23T19:02:16Z")

</div>

I just try and I cannot reproduce this error on ignition 8.1.21

---

<div class="post-metadata">

**Author:** ![Tim\_Hansson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/tim_hansson/32/39365_2.png) [@Tim\_Hansson](https://forum.inductiveautomation.com/u/Tim_Hansson)\
**Post date:** [October 23, 2022, 7:08pm UTC](https://forum.inductiveautomation.com/t/table-toggle-switch/64986/15 "2022-10-23T19:08:33Z")

</div>

Thanks, then I'll try to find the problem elsewhere
