How do I set a refresh interval on a dashboard page?

  • 2
  • 1
  • Question
  • Updated 2 months ago
  • Answered

I'm very new to QuickBase, and I'm having a hard time figuring out how to auto-refresh a dashboard.

One of my dashboards is going to be on a standalone display, so I need to make sure it updates every couple of minutes without user interaction.

How do I do this?

Thanks in advance,

Devona

Photo of Devona

Devona

  • 20 Points

Posted 3 years ago

  • 2
  • 1
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,434 Points 20k badge 2x thumb
Create a user defined page named refresh.html with this code:

<script>
  setTimeout(function(){
     parent.location.reload(1);
  }, 5000);
</script>

Then place the page on the bottom of your application dashboard using the web page widget option. You can adjust the timer (5000 milliseconds) to suit your needs. The reason to put it at the bottom is to not overtake the information currently displayed on the dashboard.
Hi Dan,

Can I use the same thing in the record of the table?

I need to refresh out the record if some predefined conditions meet. I know it is possible with your world famous IOL technique but, need your thoughts on it.

Thanks,
Gaurav
Photo of Adam Keever

Adam Keever

  • 2,318 Points 2k badge 2x thumb
Awesome. Thanks Dan.
Dan is correct and it is Dan's code that I use



Here are my more detailed notes.

Mark,
 
It’s like you said. You make a user defined html page. Then to see its URL click the magnifying glass icon. The page opens with the URL in the pop up window’s address bar.  (ie that means make a code page using the settings like you would use to make a dashboard page except choose a Code page as the page type)
 
Pull an html widget into the dashboard with that user defined page URL. I put my widget at the bottom so as not to take up valuable top of browser real estate.
 
Works like a charm.

e.g. URL that gets pasted into the dashboard widget will look like  is yqc.quickbase.com/db/be53mi1234?a=dbpage&pageID=4


This is what goes in the Code Page

Content:
<script>
  window.setInterval(function() {
    window.top.location.reload(true);
  }, 15000);
</script>
Mark,

Do we face any performance issue or any slowness issue after applying the above code? because I want to use this code in the record and want to refresh the page when certain conditions meet.

Thanks,

Gaurav
It worked fine for me.
Okay. Sounds good. Thanks Mate :)
Photo of Kelly

Kelly

  • 1,902 Points 1k badge 2x thumb
I only need the page to refresh every 5 minutes. How would I express that in this formula.
That formula will refresh every 15 seconds. 15 minutes would be 900000 milliseconds.
Photo of Geoffrey

Geoffrey

  • 2,010 Points 2k badge 2x thumb
Hi Dan.  When creating a user defined page, is this the same as creating a new "code" page from within the quickbase settings area?
Photo of Geoffrey

Geoffrey

  • 2,010 Points 2k badge 2x thumb
I seemed to have got this right, but the script runs to refresh the entire page.  Is there no way of having it just refresh the specific report/table within the dashboard?
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,434 Points 20k badge 2x thumb
Reports are included on the page inside a simple <div> rather than inside an <iframe> so you have to refresh the page in order to refresh the report. Unless you have performance problems or absolute requirements to refresh just the report I would go with the solution you have now. If you need further help refreshing on the the report information feel free to contact me off-world using the information in my profile.
Photo of Gary Boyd

Gary Boyd

  • 850 Points 500 badge 2x thumb
Is it possible to use this technique to redirect to a different form in your QB app? I'd like to setup an auto redirect to forms. The redirect will be to different tables, when a user initially logs in, based on the user role and other logic.
Setting the delay to 1ms will seem instant, but is there a way to automatically go to a different page, which is a form, rather than a reload? 2 snippets relating from above:

parent.location.reload(1);

window.top.location.reload(true);
Photo of Howard Fu

Howard Fu

  • 324 Points 250 badge 2x thumb
I've used this on my own dashboard and everything is working but how do I change it so that it refreshes daily?
Photo of AustinK

AustinK

  • 1,176 Points 1k badge 2x thumb
Generally it is used to update the page every few minutes or even seconds.

Out of curiosity what would be your use case for updating the page once a day? Does your data not change from the start of the day?
Photo of Howard Fu

Howard Fu

  • 324 Points 250 badge 2x thumb
Correct - the data would only change daily. However, now I want to update every hour....so same question. How would I do that?
Photo of AustinK

AustinK

  • 1,176 Points 1k badge 2x thumb
Just change the timeout to be an hour in milliseconds. One second = 1,000 milliseconds so one hour = 3600000 milliseconds. In the script up top just change the bolded 5000 to the number you want.
Photo of Howard Fu

Howard Fu

  • 324 Points 250 badge 2x thumb
thank you! Just curious, if I want to do daily, do I just add a ton of zeros or can the units be changed so that they are not milliseconds.
Photo of AustinK

AustinK

  • 1,176 Points 1k badge 2x thumb
I'm not sure If there is a better way but yes you just have a huge number in the end if you want to do days at a time.

I think the code works well for keeping data up to date with many refreshes throughout the day but it is not the best at refreshing once a day. I'm sure you could change it but the main issue with using this to refresh once a day is the user will have to trigger the script 24 hours before it will refresh the page. So the user would have to load the page at 7am to make sure it refreshed at 7am again tomorrow. If they refresh the page manually during the day it will reset the timer to be 24 hours(or whatever you set) from that point.

Here is a good site I found for converting standard units like hours, minutes, seconds to milliseconds. http://sstut.com/javascript/convert-hours-minutes-seconds-to-milliseconds.php
(Edited)