Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

249
Views
How to Inject JavaScript in Web Page to Automatically Hit Refresh Button

I want to update the given dataset every 1 min. ideally, so far I've understood the best scenario is either every 1h or every 15min from Power BI. I've noticed, however, that if I click the 'refresh now' button in my workspace, then subsequently the respective dashboard and report will get updated every single time that button is hit!-although those pages need to be reloaded, this could be solved with tools like the Auto Refresh Plus extension that can do the job.

Hence, is there a way to embed JavaScript in the webpage of the screenshot below, that will automatically click the 'refresh now' button every e.g. 1min? The 'refresh now' button is just left to the 'Dataset' in the grey frame (it cannot be seen due to screenshot), right of the 'test_rig_dashboard'.

The most similar approach I've researched is this with the following JavaScript insertion:

javascript:if(window.autoRefreshInterval) { clearInterval(window.autoRefreshInterval); };
window.autoRefreshInterval = setInterval(function() { jQuery(".refresh").click(); },60000)

Any ideas on how can that be implemented here? I appreciate any help!

enter image description here

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

  • Right-click on element of interest and click "Inspect". Should open your browser dev tools where you can see something like this.
  • Right-click on the element's corresponding html and click "Add Attribute", then add an id attribute making sure it doesn't already exist. Your element should now look like this.
  • To verify that your element can now be selected, go to the console tab of the dev tools and use the document.getElementById() method.
  • Finally, use the click() method of your selection inside a setInterval() to simulate clicking on the element periodically like this. The second parameter is time in milliseconds, so in your case it should amount to 60*1000.
about 4 years ago · Juan Pablo Isaza Report

0

For future users, just to add up upon @ptourlas answer, I achieved to do something similar by using only the class name of the button, since in this case, the button has no id. Skip the "Add Attribute" in 'Elements', and in 'Console' do:

setInterval(function(){document.getElementsByClassName("<class name>")[0].click();},30000);
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!