Jump to content

How to schedule (auto-trigger) python data function at some regular interval to pull out latest data


Mitul Gandhi

Recommended Posts

We have created Python data function using "Register data functions" utility to connect to REST endpoints to pull out data into spotfire for visualization.

But did not find a way to schedule (auto-trigger) this python data function at some regular interval to pull out latest data into spotfire.

Can someone help?

Link to comment
Share on other sites

Hello,

To start with, will the end users be using the analysis in a web client (Web Player) so a solution involving Scheduled Updates can be used (preferred, regular updates of data is one of the main use cases for it), or are you looking for a solution that could be used in the installed client/Analyst, triggering the python data function regularly?

 

Link to comment
Share on other sites

@Mitul Gandhi​ 

There is little functionality out of the box to auto-refresh the installed client once an analysis file has been loaded. However, with a little work it is possible to:

  1. Create a data function that refresh automatically depending on a document property containing, say, the current time now.
  2. Create a JS function that updates the document property with the latest system time, initiating a refresh of the data function (since it "subscribes" on the change of value through the auto refresh setting in the data function)
  3. Create a JS function that executes (2) using a timer
  4. Put (2,3) in a TextArea/Mod.

It is not fail proof, as the text area may be disposed when the page is navigated away from, causing the timer to cease running. But it should work for displaying a visualisation that has its underlying data (data function) run periodically.

Hope this helps

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...