Skip to main content

Refresh BigQuery data in Sheets using Apps Script and Macros

Recently the BigQuery data connector was released to enable clients to effectively import information from bigger datasets into Sheets. Presently, you can utilize devices like Apps Script and the large macro recorder to plan automatic updates inside Sheets to the associated BigQuery data.

Reasons to use it

Remain over the best in class information crucial to your business via automatically refreshing the BigQuery information in your sheet.

For instance, you can set sales data to automatically refresh with the goal that it's prepared for analysis toward the start of every day. You can likewise auto-refresh information in preparation of key meetings or introductions that happen on a weekly or monthly basis. Or on the other hand you could set a trigger to auto-refresh your information each time you open the spreadsheet.
This feature will be ON by default.

When you compare data in Sheets and BigQuery, the following procedure should be adopted.

To compare data, you might need to change the data type. For example, if a column is string data in BigQuery, then it must be plain text in Sheets to be compared correctly.If the data type in the spreadsheet and BigQuery are different, you can:

  • Change how the data is formatted in Sheets. For example, data formatted as number could be changed to plain text.
  • Cast the value in a query. For example: WHERE zip_code = CAST(@ZIP AS string) 

Please note

  • When you run a query, your spreadsheet permissions are used, not the spreadsheet owner’s.
  • You can pull up to 10,000 rows per query from BigQuery.
  • You can scan up to 1 TB of data in a single query in Sheets.
  • Data that you pull from BigQuery is read-only.
  • Only standard SQL is supported by BigQuery. 
Record a macro to refresh your data
  • On your computer, open a spreadsheet that contains data connected to BigQuery in Google Sheet.
  • 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

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.

Comments

Popular Posts

Life at Finetech - Episode 2 - Support Engineering

Transform item advancements into key customer arrangements. The foundation of Finetech prosperity, the record directors, specialists, administrators, and experts in these parts are altogether devoted to first rate customer support. 

In the case of consulting with 300 organizations around Sri Lanka and abroad, explaining specialized difficulties for independent companies, or surfacing item advertisements in simply the correct place, we grow new business openings while expanding the utilization of our item offerings.

Finetech Support Team , is playing an important role in the field of business.Lets hear about the experience of the Support Engineering team.

This is Chamathka Fernando , Renewal & Customer Support specialist at Finetech.

7 years of previous experience while achieving a Degree in Business management , HND in Human Resource Management  ( University of Dublin)  and HND in Marketing. She is also an Old Bridgateen with passion and well known for undertaking and consulting the e…

Life at Finetech - Episode 4 - Software Engineering 1

In the case of consulting with 400+ organizations around Sri Lanka and abroad, explaining specialized difficulties for independent companies, and providing with significant solutions, we grow new business openings while expanding the utilization of our item offerings.
Finetech Software Team, is playing an important role in the field of business. Lets hear about the experience of the Software Engineering Team.
The team is crushing it — the road-map is clear, features are taking shape. The product manager is happy with the progress. Engineers are excited about their tasks upto now. Maintaining that rhythm is the first pillar of the tech lead’s job. Lets hear the story of Tech Lead @ Finetech.
Raminda Dayananda- Tech Lead



5 years of experience while achieving a Bsc Degree in Management and IT from University of Kelaniya, He is also an old Maliyadevian with passion and well known for undertaking and leading the software engineering team at Finetech.

Let's hear what Raminda says,

" It …

Life at Finetech - Episode 5 - Software Engineering 2

In the earlier article it was only about one fourth of our software team, today’s interview is about few more people .The team of Jagath, Chamini, Kalana, Chamath & Ajantha, is playing an essential role to make sure the software team is going. Also the contribution they make cannot be measured.

Jagath Priyashantha - Software Engineer

Jagath has completed his BSc in (Software Engineering) at Java Institute while achieving Diploma in BIT, Graphic Designing (IBTS), Professional Certification in Java Technology at Java Institute. Jagath is a product  of St. Peter’s College, Negombo.

Let’s see what software engineer "Jaga" has to say,

As a software engineer, I work in a constantly evolving environment, due to technological advances and the strategic direction of the organisation. We create, maintain, audit and improve systems to meet particular needs, often as advised by a systems analyst or architect, testing software systems to diagnose and resolve system faults.

To do all this…