# update automatic data input

**URL:** https://discourse.paraview.org/t/update-automatic-data-input/3222
**Category:** ParaView Support
**Tags:** vtk
**Created:** [December 22, 2019, 6:05am UTC](https://discourse.paraview.org/t/update-automatic-data-input/3222 "2019-12-22T06:05:12Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![nicolas.vuaille](https://discourse.paraview.org/user_avatar/discourse.paraview.org/nicolas.vuaille/32/5873_2.png) [@nicolas.vuaille](https://discourse.paraview.org/u/nicolas.vuaille)
#### Post date: [December 23, 2019, 9:49am UTC](https://discourse.paraview.org/t/update-automatic-data-input/3222/2 "2019-12-23T09:49:21Z")

</div>

There is no option in menu to do that. You will need a `Live Programmable Source`.

in the `Script’ part, put vtkPython code to read your file

```python
from paraview.vtk.vtkIOXML import vtkXMLUnstructuredGridReader as vtuReader
# adapt here to use the appropriate reader
reader = vtuReader()
reader.SetFileName('/path/to/file.vtu')
reader.Update()

self.GetOutputDataObject(0).ShallowCopy(reader.GetOutput())

```

in the second part, `Script (CheckNeedsUpdate)`, write the conditionnal check you want. The first script will be executed only when `SetNeedsUpdate(True)` is called in this second script.

```python
import time
if not hasattr(self, "_my_time"):
  setattr(self, "_my_time", time.time())

t = time.time()
lastTime = getattr(self, "_my_time")
# adapt here to set the time (in sec) you want to wait between updates
if t - lastTime > 60:
  setattr(self, "_my_time", t)
  self.SetNeedsUpdate(True)

```

---

_[View the full topic](https://discourse.paraview.org/t/update-automatic-data-input/3222)._
