A better way to create dataset using script

I am current using the following way to create a dataset using python:

  1. clicking binding.
  2. choose expression.
  3. enter "1" in expression.
  4. add a transform, choose script.
  5. enter script to create a dataset.
  6. pass the dataset to return.

It works fine, but from time to time I found that the dataset does not refresh unless I leave the view and return, or using refreshbinding command.

Is there any better way to create a dataset that can be refreshed automatically by defined time interval?

Instead of using a constant expression, use now(1000) or similar. Or better, make a function in a project library script that you can call to make the dataset. Then your expression would be just:

runScript('somelibrary.somescript.somefunction', 1000)

Adjust the poll time as desired. No transform required. (Single runScript() has less overhead than expression+transform.)

3 Likes

Great idea.
Now I get work to be done during the weekend.