# Issue with refreshing a dataset of a table in script

**URL:** <https://forum.inductiveautomation.com/t/issue-with-refreshing-a-dataset-of-a-table-in-script/21753>\
**Category:** Ignition Early Access\
**Created:** [January 9, 2019, 3:08am UTC](https://forum.inductiveautomation.com/t/issue-with-refreshing-a-dataset-of-a-table-in-script/21753 "2019-01-09T03:08:18Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![sudipta.tripathy](https://avatars.discourse-cdn.com/v4/letter/s/c57346/32.png) [@sudipta.tripathy](https://forum.inductiveautomation.com/u/sudipta.tripathy)\
**Post date:** [January 9, 2019, 3:08am UTC](https://forum.inductiveautomation.com/t/issue-with-refreshing-a-dataset-of-a-table-in-script/21753/1 "2019-01-09T03:08:19Z")

</div>

I have the following script in the click event of a button to refresh the data in a table

```
    table=self.getSibling("Table1")
system.db.refresh(table, "data") 

```

I see the following error in the Gateway logger.

com.inductiveautomation.ignition.common.script.JythonExecException: Traceback (most recent call last): File “”, line 13, in runAction AttributeError: ‘com.inductiveautomation.ignition.common.script.Imm’ object has no attribute ‘refresh’

at org.python.core.Py.AttributeError(Py.java:207)

at org.python.core.PyObject.noAttributeError(PyObject.java:1032)

at org.python.core.PyObject. **getattr** (PyObject.java:1027)

at org.python.pycode.\_pyx51.runAction$1(:13)

at org.python.pycode.\_pyx51.call\_function()

at org.python.core.PyTableCode.call(PyTableCode.java:171)

at org.python.core.PyBaseCode.call(PyBaseCode.java:308)

at org.python.core.PyFunction.function\_\_\_call\_\_(PyFunction.java:471)

at org.python.core.PyFunction. **call** (PyFunction.java:466)

at org.python.core.PyFunction. **call** (PyFunction.java:456)

at org.python.core.PyFunction. **call** (PyFunction.java:451)

at com.inductiveautomation.ignition.common.script.ScriptManager.runFunction(ScriptManager.java:674)

at com.inductiveautomation.ignition.common.script.ScriptManager$ScriptFunctionImpl.invoke(ScriptManager.java:790)

at com.inductiveautomation.perspective.gateway.script.ScriptFunctionHelper.invoke(ScriptFunctionHelper.java:82)

at com.inductiveautomation.perspective.gateway.action.ScriptAction.runAction(ScriptAction.java:64)

at com.inductiveautomation.perspective.gateway.action.ActionDecorator.runAction(ActionDecorator.java:18)

at com.inductiveautomation.perspective.gateway.action.SecuredAction.runAction(SecuredAction.java:39)

at com.inductiveautomation.perspective.gateway.model.ActionCollection$ActionSequence$ExecuteActionsTask.lambda$call$0(ActionCollection.java:257)

at com.inductiveautomation.perspective.gateway.api.LoggingContext.mdc(LoggingContext.java:54)

at com.inductiveautomation.perspective.gateway.model.ActionCollection$ActionSequence$ExecuteActionsTask.call(ActionCollection.java:246)

at com.inductiveautomation.perspective.gateway.model.ActionCollection$ActionSequence$ExecuteActionsTask.call(ActionCollection.java:215)

at com.inductiveautomation.perspective.gateway.threading.BlockingTaskQueue$TaskWrapper.run(BlockingTaskQueue.java:154)

at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)

at java.base/java.util.concurrent.FutureTask.run(Unknown Source)

at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

at java.base/java.lang.Thread.run(Unknown Source)

Caused by: org.python.core.PyException: Traceback (most recent call last): File “”, line 13, in runAction AttributeError: ‘com.inductiveautomation.ignition.common.script.Imm’ object has no attribute ‘refresh’

… 27 common frames omitted

---

<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:** [January 9, 2019, 3:52pm UTC](https://forum.inductiveautomation.com/t/issue-with-refreshing-a-dataset-of-a-table-in-script/21753/2 "2019-01-09T15:52:10Z")

</div>

`system.db.refresh()` is a Vision client only command. To perform the equivalent in Perspective, just use `someComponent.refreshBinding("path")` - the component can be any component reference, and `path` is just the path to the particular property.

---

<div class="post-metadata">

**Author:** ![sudipta.tripathy](https://avatars.discourse-cdn.com/v4/letter/s/c57346/32.png) [@sudipta.tripathy](https://forum.inductiveautomation.com/u/sudipta.tripathy)\
**Post date:** [January 9, 2019, 4:27pm UTC](https://forum.inductiveautomation.com/t/issue-with-refreshing-a-dataset-of-a-table-in-script/21753/3 "2019-01-09T16:27:41Z")

</div>

Thanks for your suggestion. It worked. Here is what I did,

table=self.getSibling(“Table1”)  
table.refreshBinding(“props.data”)

---

<div class="post-metadata">

**Author:** ![joe.friedrich](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/joe.friedrich/32/7505_2.png) [@joe.friedrich](https://forum.inductiveautomation.com/u/joe.friedrich)\
**Post date:** [March 7, 2019, 12:39pm UTC](https://forum.inductiveautomation.com/t/issue-with-refreshing-a-dataset-of-a-table-in-script/21753/4 "2019-03-07T12:39:29Z")

</div>

Paul, can you talk to the documentation team and have them add `someComponent.refreshBinding("path")` to the user manual? I searched for refreshBinding, but it found nothing. The tool is incredibly helpful!

---

<div class="post-metadata">

**Author:** ![jayce.oxton](https://avatars.discourse-cdn.com/v4/letter/j/8e8cbc/32.png) [@jayce.oxton](https://forum.inductiveautomation.com/u/jayce.oxton)\
**Post date:** [May 1, 2019, 5:59pm UTC](https://forum.inductiveautomation.com/t/issue-with-refreshing-a-dataset-of-a-table-in-script/21753/5 "2019-05-01T17:59:14Z")

</div>

Let’s say the binding is to a named query with caching enabled. Is there a way to refresh the binding and force it to bypass caching? I noticed that is an option in the binding itself. This would be helpful if I a table displaying the content of a database table along side a form that is used to update a record in the table.

---

<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:** [May 1, 2019, 6:01pm UTC](https://forum.inductiveautomation.com/t/issue-with-refreshing-a-dataset-of-a-table-in-script/21753/6 "2019-05-01T18:01:20Z")

</div>

> [@jayce.oxton](#):
>
> Let’s say the binding is to a named query with caching enabled. Is there a way to refresh the binding and force it to bypass caching? I noticed that is an option in the binding itself. This would be helpful if I a table displaying the content of a database table along side a form that is used to update a record in the table.

Not at present, although you could use [`system.db.clearNamedQueryCache()`](https://docs.inductiveautomation.com/display/DOC80/system.db.clearNamedQueryCache) to invalidate the cache.

---

<div class="post-metadata">

**Author:** ![jayce.oxton](https://avatars.discourse-cdn.com/v4/letter/j/8e8cbc/32.png) [@jayce.oxton](https://forum.inductiveautomation.com/u/jayce.oxton)\
**Post date:** [May 1, 2019, 6:32pm UTC](https://forum.inductiveautomation.com/t/issue-with-refreshing-a-dataset-of-a-table-in-script/21753/7 "2019-05-01T18:32:59Z")

</div>

That worked perfectly! Thank you!

---

<div class="post-metadata">

**Author:** ![jayce.oxton](https://avatars.discourse-cdn.com/v4/letter/j/8e8cbc/32.png) [@jayce.oxton](https://forum.inductiveautomation.com/u/jayce.oxton)\
**Post date:** [August 6, 2019, 9:31pm UTC](https://forum.inductiveautomation.com/t/issue-with-refreshing-a-dataset-of-a-table-in-script/21753/8 "2019-08-06T21:31:17Z")

</div>

I’m now running into an issue in my project after I moved my view to a global project. My project now inherits this view from the global project. For some reason the cache no longer clears and I’m not getting any errors in the log. Thoughts?

---

<div class="post-metadata">

**Author:** ![Apurba\_Roy](https://avatars.discourse-cdn.com/v4/letter/a/e0b2c6/32.png) [@Apurba\_Roy](https://forum.inductiveautomation.com/u/Apurba_Roy)\
**Post date:** [May 17, 2022, 3:13pm UTC](https://forum.inductiveautomation.com/t/issue-with-refreshing-a-dataset-of-a-table-in-script/21753/9 "2022-05-17T15:13:39Z")

</div>

Please elaborate it with an example. I didn’t follow, someComponent? and “path”?. I am having a similar problem in perspective where I have the following components - cooordinate container, a label, a hyperlink, a table component (the contents needs to be refreshed after certain action) and a date input component.

---

<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:** [May 17, 2022, 3:16pm UTC](https://forum.inductiveautomation.com/t/issue-with-refreshing-a-dataset-of-a-table-in-script/21753/10 "2022-05-17T15:16:42Z")

</div>

You provided more information, but not enough for me to tell you how to actually solve your problem.

You need to start from a reference to whatever component has the binding you want to re-run. You can use the property selector helper in the script editor to get one - just select a property and remove the end of the path.

And “path” is just the path to the property that contains the binding. Such as `props.value` for a simple case like a text field, or `props.data` for a table’s main data property.

---

<div class="post-metadata">

**Author:** ![Apurba\_Roy](https://avatars.discourse-cdn.com/v4/letter/a/e0b2c6/32.png) [@Apurba\_Roy](https://forum.inductiveautomation.com/u/Apurba_Roy)\
**Post date:** [May 18, 2022, 9:57am UTC](https://forum.inductiveautomation.com/t/issue-with-refreshing-a-dataset-of-a-table-in-script/21753/12 "2022-05-18T09:57:18Z")

</div>

Thanks, I am able to refresh it now
