# Refreshing a custom property of a dataset

**URL:** <https://forum.inductiveautomation.com/t/refreshing-a-custom-property-of-a-dataset/30099>\
**Category:** General Discussion\
**Created:** [November 20, 2019, 12:08am UTC](https://forum.inductiveautomation.com/t/refreshing-a-custom-property-of-a-dataset/30099 "2019-11-20T00:08:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![csanyia](https://avatars.discourse-cdn.com/v4/letter/c/48db29/32.png) [@csanyia](https://forum.inductiveautomation.com/u/csanyia)\
**Post date:** [November 20, 2019, 12:08am UTC](https://forum.inductiveautomation.com/t/refreshing-a-custom-property-of-a-dataset/30099/1 "2019-11-20T00:08:43Z")

</div>

I have a table, table1, with a custom property of a, named dataset, which is a dataset. On a script I need to refresh this data before it runs. Or when I press a button:

the script:

> system.db.refresh(event.source.parent.getComponent('table1').dataset)

errors with: Traceback (most recent call last):  
File "event:actionPerformed", line 1, in   
TypeError: refresh(): expected 2 args; got 1

> system.db.refresh(event.source.parent.getComponent('table1').dataset, "data")

errors with:  
File "event:actionPerformed", line 1, in   
TypeError: refresh(): 1st arg can't be coerced to javax.swing.JComponent

Can we refresh the data in a dataset which is a custom property?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [November 20, 2019, 12:13am UTC](https://forum.inductiveautomation.com/t/refreshing-a-custom-property-of-a-dataset/30099/2 "2019-11-20T00:13:07Z")

</div>

> [@csanyia](#):
>
> system.db.refresh(event.source.parent.getComponent(‘table1’).dataset)

The correct syntax should be:  
`system.db.refresh(event.source.parent.getComponent("table1"), "dataset")`  
The first argument is a reference to the component (`table1`), and the second argument is the _name_ of the property to refresh.
