# Reset Column Selector Values

**URL:** <https://forum.inductiveautomation.com/t/reset-column-selector-values/97375>\
**Category:** Ignition\
**Tags:** ignition81, vision, scripting\
**Created:** [October 17, 2024, 9:34am UTC](https://forum.inductiveautomation.com/t/reset-column-selector-values/97375 "2024-10-17T09:34:08Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![MUNIYANDI\_D](https://avatars.discourse-cdn.com/v4/letter/m/48db29/32.png) [@MUNIYANDI\_D](https://forum.inductiveautomation.com/u/MUNIYANDI_D)\
**Post date:** [October 17, 2024, 9:34am UTC](https://forum.inductiveautomation.com/t/reset-column-selector-values/97375/1 "2024-10-17T09:34:08Z")

</div>

Hi Everyone,

I hope all are well. I have one requirement in Column Selector. I have 180 columns containing tables and I'm using that Column Selector to hide 110 columns and show 80 columns as default. I have given one confirm button once I select or unselect the columns in the column selector click that button to apply the changes on the CS. And now my new requirement is Just I need to add one button named "Reset". If I deselect a few columns from the default 80 columns and click the confirm button those columns are hidden. Then if I click the reset button, That column selector becomes as Default stage My default 80 should need to be shown in the Column Selector. Could you please help to achieve my requirements?

Thanks & Regards,  
Muniyandi D

---

<div class="post-metadata">

**Author:** ![MUNIYANDI\_D](https://avatars.discourse-cdn.com/v4/letter/m/48db29/32.png) [@MUNIYANDI\_D](https://forum.inductiveautomation.com/u/MUNIYANDI_D)\
**Post date:** [October 18, 2024, 7:16am UTC](https://forum.inductiveautomation.com/t/reset-column-selector-values/97375/3 "2024-10-18T07:16:20Z")

</div>

Hi Everyone,

Sorry for looping you all in this Chat, I hope all of you as well. I had some doubts about ignition vision component scripting using SDK scripting in the Colunm selector component. I have tried in multiple ways but no one Works well. Previously I see one chat but the need is to select or deselect all values, but my requirement is slightly different from that topic. I have given my requirements below.

Now I use a column selector component to manage some columns in the dataset and I use that to table. My table's dataset column count is 194 and I should need to show 81 columns as default. If the client opens this window only 81 column values are shown in the table. and other columns should be disabled in the column selector component.

If the Client wants to see more columns, they should select the columns they want. After client selection, 90 columns will appear. Now they need to see the default 81 columns, so I gave one reset button below the column selector when the client clicks the button, automatically 81 columns should be selected in the column selector component and the Data\_out property of the column selector component.

Could you please anyone can help me to achieve my requirements as soon as possible?

`My error script`

```python
import java.util.ArrayList
import java.util.List
import com.inductiveautomation.factorypmi.plugins.reporting.components.columnselector.DataSetConfig
from com.inductiveautomation.factorypmi.plugins.reporting.components.columnselector import ColumnFilteredDataSet, DataSetConfig
from com.inductiveautomation.factorypmi.plugins.reporting.components.columnselector import DataSetConfig

column_selector = event.source.parent.getComponent('Column Selector')

ColumnFilteredDataSet.setColumnFiltered("Substrate ID", False)

```

While using this Script, I got an argument and self-arg data error,  
argument error :

```python
File "event:mouseClicked", line 49, in
TypeError: setColumnFiltered(): expected 3 args; got 2

self-arg data error:

self arg can't be coerced to com.inductiveautomation.factorypmi.plugins.reporting.components.columnselector.DataSetConfig

```

Thanks & Regards,  
Muniyandi D

---

<div class="post-metadata">

**Author:** ![Matrix\_Engineering](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/matrix_engineering/32/19781_2.png) [@Matrix\_Engineering](https://forum.inductiveautomation.com/u/Matrix_Engineering)\
**Post date:** [October 18, 2024, 8:00am UTC](https://forum.inductiveautomation.com/t/reset-column-selector-values/97375/4 "2024-10-18T08:00:36Z")

</div>

1. You already replied in an existing thread.
2. You didn't format your code, use this  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/3/e36b5102cfa5c57d08f82cb9dfd072935e328a59.png)
3. No need to tag Phil Turmel, he reads every thread on the forum

---

<div class="post-metadata">

**Author:** ![MUNIYANDI\_D](https://avatars.discourse-cdn.com/v4/letter/m/48db29/32.png) [@MUNIYANDI\_D](https://forum.inductiveautomation.com/u/MUNIYANDI_D)\
**Post date:** [October 18, 2024, 8:56am UTC](https://forum.inductiveautomation.com/t/reset-column-selector-values/97375/5 "2024-10-18T08:56:36Z")

</div>

Sorry @Matrix_Engineering for my inconvenience in activities of 1 and 3 lines in your commend.  
I removed Phil from my Thread. But I didn't get 2nd one. Can you please explain that 2nd one Briefly?

Thanks & Regards,  
Muniyandi D

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [October 18, 2024, 12:03pm UTC](https://forum.inductiveautomation.com/t/reset-column-selector-values/97375/6 "2024-10-18T12:03:22Z")

</div>

Read this, it's all explained there:

> [@Wiki - how to post code on this forum](https://forum.inductiveautomation.com/t/wiki-how-to-post-code-on-this-forum/77831):
>
> This thread is intended as a short help file for all those struggling to post formatted code on the forum. Code block formatting Posting formatted code on the forum (and most others) is as simple as selecting the code and pressing the \</\> button. It works the same as applying Bold or Italic styles to your document. It preserves indentation and applies syntax highlighting. [How to post code] Note that all the \</\> button does is add three backticks ``` on the line before the code block and anot…

---

<div class="post-metadata">

**Author:** ![MUNIYANDI\_D](https://avatars.discourse-cdn.com/v4/letter/m/48db29/32.png) [@MUNIYANDI\_D](https://forum.inductiveautomation.com/u/MUNIYANDI_D)\
**Post date:** [October 19, 2024, 2:00pm UTC](https://forum.inductiveautomation.com/t/reset-column-selector-values/97375/7 "2024-10-19T14:00:28Z")

</div>

Now I understand @pascal.fragnoud . And now I have edited my thread. Can you please check now ?

---

<div class="post-metadata">

**Author:** ![Matrix\_Engineering](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/matrix_engineering/32/19781_2.png) [@Matrix\_Engineering](https://forum.inductiveautomation.com/u/Matrix_Engineering)\
**Post date:** [October 19, 2024, 2:47pm UTC](https://forum.inductiveautomation.com/t/reset-column-selector-values/97375/8 "2024-10-19T14:47:53Z")

</div>

> [@MUNIYANDI\_D](#):
>
> import java.util.ArrayList  
> import java.util.List  
> import com.inductiveautomation.factorypmi.plugins.reporting.components.columnselector.DataSetConfig  
> from com.inductiveautomation.factorypmi.plugins.reporting.components.columnselector import ColumnFilteredDataSet, DataSetConfig  
> from com.inductiveautomation.factorypmi.plugins.reporting.components.columnselector import DataSetConfig

This too, please

---

<div class="post-metadata">

**Author:** ![Matrix\_Engineering](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/matrix_engineering/32/19781_2.png) [@Matrix\_Engineering](https://forum.inductiveautomation.com/u/Matrix_Engineering)\
**Post date:** [October 19, 2024, 2:48pm UTC](https://forum.inductiveautomation.com/t/reset-column-selector-values/97375/9 "2024-10-19T14:48:44Z")

</div>

Is that your full code, because it looks just like imports, not actual CS code.

Your error message says line 49, please post at least 49 lines of code.

Also, it is telling you that you have supplied 2 args, but the function expects 3.

---

<div class="post-metadata">

**Author:** ![MUNIYANDI\_D](https://avatars.discourse-cdn.com/v4/letter/m/48db29/32.png) [@MUNIYANDI\_D](https://forum.inductiveautomation.com/u/MUNIYANDI_D)\
**Post date:** [October 19, 2024, 4:20pm UTC](https://forum.inductiveautomation.com/t/reset-column-selector-values/97375/10 "2024-10-19T16:20:00Z")

</div>

Now I added that too...

And I had put that script in Button.

I hadn't used this SDK scripting before. For now, this is my last option to achieve my requirements. On the SDK page, they have mentioned only 2 inputs for "setColumnFiltered" function. that's why I give only two inputs. But I don't what was the 3rd arg. But, I gives the Column Selector component's path into this function it throws an error like.,

```python
self-arg data error:

self arg can't be coerced to com.inductiveautomation.factorypmi.plugins.reporting.components.columnselector.DataSetConfig

```

---

<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:** [October 19, 2024, 4:25pm UTC](https://forum.inductiveautomation.com/t/reset-column-selector-values/97375/11 "2024-10-19T16:25:28Z")

</div>

> [@MUNIYANDI\_D](#):
>
> `ColumnFilteredDataSet.setColumnFiltered("Substrate ID", False)`

This is not legal in jython nor in java. You are calling an **instance** method on a **class** definition.

`setColumnFiltered()` is **method** , not a function. You need an instance of that type to use that method.

If `column_selector` is that type, then you would do:

```python
column_selector.setColumnFiltered(....)

```

( I haven't looked closely... )

---

<div class="post-metadata">

**Author:** ![MUNIYANDI\_D](https://avatars.discourse-cdn.com/v4/letter/m/48db29/32.png) [@MUNIYANDI\_D](https://forum.inductiveautomation.com/u/MUNIYANDI_D)\
**Post date:** [October 19, 2024, 4:42pm UTC](https://forum.inductiveautomation.com/t/reset-column-selector-values/97375/12 "2024-10-19T16:42:29Z")

</div>

Sorry @pturmel for i can't able to catch what are you saying. Can you explain it with an example?

Thanks & Regards  
Muniyandi D

---

<div class="post-metadata">

**Author:** ![Matrix\_Engineering](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/matrix_engineering/32/19781_2.png) [@Matrix\_Engineering](https://forum.inductiveautomation.com/u/Matrix_Engineering)\
**Post date:** [October 19, 2024, 5:00pm UTC](https://forum.inductiveautomation.com/t/reset-column-selector-values/97375/13 "2024-10-19T17:00:27Z")

</div>

You still haven't posted your entire code.

Why is this an onMouseClick event?

Phil is the better man for explaining the correct terminology of what you're doing wrong here. My background is mechatronics not pure code.

Post your entire code and someone can advise if there is a better, more succint way.

---

<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:** [October 19, 2024, 5:11pm UTC](https://forum.inductiveautomation.com/t/reset-column-selector-values/97375/14 "2024-10-19T17:11:36Z")

</div>

You are importing classes that the SDK implies you need, but that is not how you apply that information in most cases. Instead, the SDK tells you what you can **do** with an instance of that class when you _ **get one in context** _, that is, from the event or extension function.

For example, the [initialize()](https://www.docs.inductiveautomation.com/docs/8.1/appendix/components/vision-components/tables/power-table/power-table-scripting-functions#initialize) extension function gives you the Power Table itself as `self`, from which you can use the methods documented for the [VisionAdvancedTable](https://files.inductiveautomation.com/sdk/javadoc/ignition81/8.1.38/com/inductiveautomation/factorypmi/application/components/VisionAdvancedTable.html).

In events, you usually get the component from `event.source`, after which you drill in (with methods and properties) to the instance you care about, then use its methods to make adjustments.

FWIW, I would be manipulating the Column Attributes Dataset of the table to hide columns, not trying to mess with the table's implementation details (which will keep getting reset on data changes).

---

<div class="post-metadata">

**Author:** ![MUNIYANDI\_D](https://avatars.discourse-cdn.com/v4/letter/m/48db29/32.png) [@MUNIYANDI\_D](https://forum.inductiveautomation.com/u/MUNIYANDI_D)\
**Post date:** [January 22, 2025, 10:52am UTC](https://forum.inductiveautomation.com/t/reset-column-selector-values/97375/15 "2025-01-22T10:52:46Z")

</div>

Hi everyone,

Sorry for my late response. I have slightly loaded in work and focused on completing that on time. Sorry, @Matrix_Engineering this is my full code. I had put that code in after some lines. The error only comes from `ColumnFilteredDataSet.setColumnFiltered("Substrate ID", False)`. I had put this in the 49th line. That's why the error is showing the line 49. Still, I'm not completing this requirement. Because I'm searching multiple chats and trying multiple methods but no one has useful. Which method I tried failed. Recently @pturmel has given some suggestions, but I'm slightly not well in SDK Scripting. Because that SDK scripting was confusing me, that's why I'm suffering in the SDK scripting.

Thanks,  
Muniyandi D

---

<div class="post-metadata">

**Author:** ![MUNIYANDI\_D](https://avatars.discourse-cdn.com/v4/letter/m/48db29/32.png) [@MUNIYANDI\_D](https://forum.inductiveautomation.com/u/MUNIYANDI_D)\
**Post date:** [January 22, 2025, 10:57am UTC](https://forum.inductiveautomation.com/t/reset-column-selector-values/97375/16 "2025-01-22T10:57:28Z")

</div>

Can anyone guide me to improve my knowledge of how to develop a script using SDK? Importing the required Java function in confusing me.

Thanks,  
Muniyandi D
