# Clear Table Results

**URL:** <https://forum.inductiveautomation.com/t/clear-table-results/6215>\
**Category:** Ignition\
**Created:** [April 12, 2013, 5:20pm UTC](https://forum.inductiveautomation.com/t/clear-table-results/6215 "2013-04-12T17:20:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cacordova](https://avatars.discourse-cdn.com/v4/letter/c/bbce88/32.png) [@cacordova](https://forum.inductiveautomation.com/u/cacordova)\
**Post date:** [April 12, 2013, 5:20pm UTC](https://forum.inductiveautomation.com/t/clear-table-results/6215/1 "2013-04-12T17:20:40Z")

</div>

[code]headers = [“Value”,“Label”]  
data = []

clear\_data = system.dataset.toDataSet(headers,data)  
event.source.parent.getComponent(‘Dropdown’).data = clear\_data  
[/code]

I have this code that clears the data on the my second drop down list ,  
what about when I want to delete the records on the table when the label “” is chosen on the drop down list, kind of just clears the record…

---

<div class="post-metadata">

**Author:** ![CPowell](https://avatars.discourse-cdn.com/v4/letter/c/a183cd/32.png) [@CPowell](https://forum.inductiveautomation.com/u/CPowell)\
**Post date:** [April 12, 2013, 6:22pm UTC](https://forum.inductiveautomation.com/t/clear-table-results/6215/2 "2013-04-12T18:22:48Z")

</div>

I think this is what you want to do.

Add this code to the property change on the drop down menu:

```auto
if event.source.selectedLabel == '<Select>':
	headers = ["Value","Label"]
	data = []
	clear_data = system.dataset.toDataSet(headers,data)
	event.source.parent.getComponent('Table').data = clear_data

```

Chris

---

<div class="post-metadata">

**Author:** ![cacordova](https://avatars.discourse-cdn.com/v4/letter/c/bbce88/32.png) [@cacordova](https://forum.inductiveautomation.com/u/cacordova)\
**Post date:** [April 12, 2013, 6:31pm UTC](https://forum.inductiveautomation.com/t/clear-table-results/6215/3 "2013-04-12T18:31:23Z")

</div>

it did clear the whole table. but i just wanted to clear the results that was on column 3

---

<div class="post-metadata">

**Author:** ![CPowell](https://avatars.discourse-cdn.com/v4/letter/c/a183cd/32.png) [@CPowell](https://forum.inductiveautomation.com/u/CPowell)\
**Post date:** [April 12, 2013, 7:25pm UTC](https://forum.inductiveautomation.com/t/clear-table-results/6215/4 "2013-04-12T19:25:26Z")

</div>

Like this:

```auto
if event.source.selectedLabel == '<Select>':
	#Set column number. Starts at 0 from left.
	col = 2
	temp_data = event.source.parent.getComponent('Table').data
	for row in range(temp_data.rowCount):
		temp_data = system.dataset.setValue(temp_data, row, col, '')
	
	event.source.parent.getComponent('Table').data = temp_data

```

Chris

---

<div class="post-metadata">

**Author:** ![cacordova](https://avatars.discourse-cdn.com/v4/letter/c/bbce88/32.png) [@cacordova](https://forum.inductiveautomation.com/u/cacordova)\
**Post date:** [April 12, 2013, 9:01pm UTC](https://forum.inductiveautomation.com/t/clear-table-results/6215/5 "2013-04-12T21:01:12Z")

</div>

Cool it worked! Thank You! ![:thumb_left:](https://us1.discourse-cdn.com/inductiveautomation/original/1X/e26afb081ddde6df016df6ee49159cf56aaca688.gif ":thumb\_left:")
