Column Hiding

(newbie)I really could use a basic example, wasted too much time on this

I merely want a table column’s visibility to be driven from say a checkbox or a button event.
I thought maybe I could use something like:

Maybe it’s working but I’ve called out incorrect column?

What is easy way to confirm which column is visibility/hide ?

Thanks! Would love to end week having solved this

You were close. Just need to write the data back to the table.
Also, you want column 2 not 3 if you want to the hide attribute.

if event.source.selected : #This is the check box I created.
	newData = system.dataset.setValue(table.columnAttributesData,1,2,1)
	table.columnAttributesData = newData
	newData = system.dataset.setValue(table.columnAttributesData,1,2,0)
	table.columnAttributesData = newData

or you could lose the if statement since it is a check box.

newData = system.dataset.setValue(table.columnAttributesData,1,2,event.source.selected)
table.columnAttributesData = newData


That’s it, I VERY much appreciate it