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

332
Views
How to schedule a BigQuery run through Apps Script

I have a connected sheet that has results of a bigquery query(extract sheet). I created a preview of the results sheet. How do i write an appscript fuction to refresh the results in the extract and preview sheets? Please help.

I tried to use this code to refresh the connected sheet query , but it gave me an error saying : "Exception: The data object does not exist." I would like to write an apps script function if possible.

function refresh() {
  var spreadsheet = SpreadsheetApp.getActive();
  spreadsheet.getRange('A1').activate();
  spreadsheet.setActiveSheet(spreadsheet.getSheetByName('test'), true);
  SpreadsheetApp.enableAllDataSourcesExecution();
  spreadsheet.getCurrentCell().getDataSourceTables()[0].refreshData();
  //DriveApp.getFiles()
};

enter image description here

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

0

The solution, a macro

1. Record a macro to refresh your data

  • Open the spreadsheet that contains data connected to BigQuery in Google Sheets.
  • Record a macro from a different tab then the one you want to refresh.
  • After you start recording, switch to the tab you want to refresh.
  • At the bottom left, click Refresh.
  • Click Save.

2. Schedule your macro

  • At the top, click Tools > Script editor.
  • At the top, click Edit > Current project’s triggers.
  • At the bottom right, click Add trigger and select your options.
  • Click Save.
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!