Reputation: 273
We frequently use Google Apps script to run BigQuery queries and put them into a Google Sheet. However, the workflow is annoying:
Is there some way to just save a query using BigQuery's save function, and then call that specific query from a script?
Upvotes: 4
Views: 4546
Reputation: 172964
BigQuery Team definitely has some secret sauce here as they actually have this functionality in their Native BigQuery UI – you can save and then reuse it from within that UI
As of using saved query programmatically I can recommend this route:
Upvotes: 0
Reputation: 323
At my blog, I wrote an article that shows how to front-end a BigQuery project with a Google Apps Script application "owned" by a Google Drive spreadsheet. The article describes a simple example application available at my GitHub repository. This sample application
1) builds a web page that directly queries BigQuery
2) shows the result set on the web page
3) mirrors the result set on the spreadsheet
The sample solution has two small files - that's it. You probably have a BigQuery project more complicated than the one featured in the article, but the main idea of the article / sample should extend to your situation.
Upvotes: 0
Reputation: 546
If you query data in BigQuery, build reports and visualize results on a regular basis, you will enjoy our free Add-on for Google Sheets.
It will make your workflow easier.
Benefits:
Any suggestions and comments are welcome.
Upvotes: -1
Reputation: 3172
Its a workaround...
try saving as a view, and execute a simple
Select * from MyView
Upvotes: 3