Using Interval time frames


#1

Hi there , I am exploring the product and I expect to work on it for IOT projects for a while.
May be I am missing some existing features, I would like to call to some external service for get some data and expose this information on dashboard and graphics.
At this point NodeRun seems to work as expected, but I need that this data were called on some intervals for about 60 segs, at least.
I tried to use setInterval from javascript, but it is not working into a NodeRun module - no error but no trigger -
May be you can help me.
As someone says in a comment, I feel like if VB6 backs again .
Thanks in advance
Gabriels


#2

Hi Gabriels,

The code to periodically refresh your dashboard screen has to be on the client-side. One way to do this is to put it into the screen’s onload event. Here is an example you can look at:

https://noderun.com/ide/jpark/stock-data/

The stock data will refresh automatically every 60 seconds.

If you look at the onload event, it looks like this:

image

It uses setTimeout() instead of setInterval() because after the refresh, the onload event fires again.

I hope this helps.