# Programmatically hide or show vision table column

**URL:** <https://forum.inductiveautomation.com/t/programmatically-hide-or-show-vision-table-column/38695>\
**Category:** Ignition\
**Created:** [September 15, 2020, 3:19pm UTC](https://forum.inductiveautomation.com/t/programmatically-hide-or-show-vision-table-column/38695 "2020-09-15T15:19:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jross2020](https://avatars.discourse-cdn.com/v4/letter/j/d26b3c/32.png) [@jross2020](https://forum.inductiveautomation.com/u/jross2020)\
**Post date:** [September 15, 2020, 3:19pm UTC](https://forum.inductiveautomation.com/t/programmatically-hide-or-show-vision-table-column/38695/1 "2020-09-15T15:19:05Z")

</div>

I can’t find a way to programmatically hide or show a given column in a Vision table. Am I missing something or is it simply not possible?

(setting width to 0 is a kludgy workaround)

---

<div class="post-metadata">

**Author:** ![c.bertulli](https://avatars.discourse-cdn.com/v4/letter/c/f19dbf/32.png) [@c.bertulli](https://forum.inductiveautomation.com/u/c.bertulli)\
**Post date:** [September 15, 2020, 3:28pm UTC](https://forum.inductiveautomation.com/t/programmatically-hide-or-show-vision-table-column/38695/2 "2020-09-15T15:28:48Z")

</div>

[http://forum.inductiveautomation.com/t/dynamically-show-hide-column-in-powertable/22801](http://forum.inductiveautomation.com/t/dynamically-show-hide-column-in-powertable/22801)

---

<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:** [September 15, 2020, 3:29pm UTC](https://forum.inductiveautomation.com/t/programmatically-hide-or-show-vision-table-column/38695/3 "2020-09-15T15:29:58Z")

</div>

For the standard table component, the easest way I have found is to store the complete dataset in a custom property, I usually call this rawData or something similar. Then when whatever event occurs that you want to add or remove column/s build a new dataset using [system.dataset.filterColumns](https://docs.inductiveautomation.com/display/DOC80/system.dataset.filterColumns) to return a dataset with only the columns you want.

---

<div class="post-metadata">

**Author:** ![code\_skin](https://avatars.discourse-cdn.com/v4/letter/c/43a26b/32.png) [@code\_skin](https://forum.inductiveautomation.com/u/code_skin)\
**Post date:** [September 15, 2020, 3:46pm UTC](https://forum.inductiveautomation.com/t/programmatically-hide-or-show-vision-table-column/38695/4 "2020-09-15T15:46:11Z")

</div>

It's possible but has some caveats with it.

This post shows how to get the columnsAttributeData and sets a column to be editable during runtime. You can probably achieve what you want manipulating the hidden attribute.

> [@Edit Column Attributes Dataset](http://forum.inductiveautomation.com/t/edit-column-attributes-dataset/21120/4):
>
> Take a look at this script. If you analyze it you should be able to see the places where your script went off track. table = event.source.parent.getComponent('Table') columnData = table.columnAttributesData newData = system.dataset.setValue(columnData, 1, 'editable', 1) table.columnAttributesData = newData

I also think it's important to read this:

> [@Column Attributes Data Refresh](http://forum.inductiveautomation.com/t/column-attributes-data-refresh/7043/2):
>
> That dataset only updates when you open the customizer. You could put a Cell Updated binding on it if you want to force some values in there, or bind the whole dataset to something else, but generally modifying the Cell Attributes dataset is a pain. It will remember rows you have already set up even if the column wasn’t there a few minutes ago.
