Sometimes it is useful for dashboards to update in "real-time". Typically, this is where the data is rapidly changing, and the view of the data from one moment is different from the next. The two main situations where real-time updating is relevant are where the data being collected is updated regularly, and where data on actions taken by the company is updated.
Requirements
A Displayr document with a data set.
Method
Real-time >= Every 10 minutes
It's never technically possible for a dashboard to update instantly. Computations take time, albeit small amounts of time. And, the more rapid the updating the more intensive the computer resources. In Displayr, "real-time" means at best, every 10 minutes.
Updating data sets
When data is read in from URLs, R, SQL, integrations (e.g., Qualtrics, Forsta), and the Displayr Cloud Drive, you can set up a Schedule to automatically update the data.
Updating the publication of a dashboard
If you follow the instructions in How to Set Up Schedules in Displayr, you can get your data to update. The next step is to control when the dashboard itself is re-published, as this is required for a viewer to see the updates.
This is also done via the Schedules function. See How to automatically republish your dashboard using a schedule.
Rookie mistakes
There are a few easy-to-make mistakes when using automatic updating.
Automatic publication of documents being manually edited
If you are making manual edits to a document, you will be warned before a schedule automatically runs. You will see a pop-up similar to:
If you click PROCEED, it will be automatically published with your incomplete edits revealed to your viewers.
Failure to sync updating
Let's say you have set your data to update every 24 hours. And, you've set your data to republish every 10 minutes. It will republish, but the results will still only change every 24 hours. Or, let's say you kick off automatic publication every Monday, but you have automatic updating of the data on Wednesday. The published document will republish on Monday, but only shows the data up until last Wednesday. See What runs when for more information.
Manual R Outputs containing UpdateAt and UpdateEvery
If you are using UpdateAt or UpdateEvery in your R code these will cause the R code to be re-run, even if Automatic is not checked on the R Output. You can either edit the code to automatically stop updating after a given date/time or you can comment out the line of code and rerun the output to immediately stop the automatic updating. Note that we suggest that you use the Schedule function rather than writing UpdateAt and UpdateEvery R code scripts.
Caching
Consider asking a computer to calculate 1+1. There are two principal ways that a computer can give you the answer. One is it can compute the answer. The other is it can search to see if it has previously answered the question, and return that result. This is known as caching and it is very widespread. It's very common that things on the internet are cached, as it both reduces computing resources and network load (as it can be cached near the end viewer). If, for example, the time stamp is not correct within 10 minutes, that is due to caching. (But, keep in mind the effect of time zones!).
A page needs to be told to update
If you are looking at a page in Displayr in your browser, you will not see the results update until something happens to make the screen refresh. Like what?
- You can press the Refresh button in your browser
- If Displayr has fallen asleep, when it wakes it will update.
- Anything that performs a calculation on the page (e.g., using a filter).
Next
How to Automatically Update R Outputs on a Schedule
How to Automatically Republish a Dashboard
How to Automatically Update Dashboards in Displayr
How to Automatically Update Calculations, Variables, and Data Sets Using R