0

I have a BigQuery View/Query that every morning I need to run and copy the result to a Google Sheet. I am using Javascript, and plan to use the node.js BigQuery client library and the Google Sheets node.js API for interacting with BigQuery and Google Sheets.
I would like to achieve this using Google's Cloud Functions but I'm not sure how to put it all together and how to schedule it.

Can someone explain which tools/products I should use and how to string them together.

Dave M
  • 4,494
  • 21
  • 30
  • 30
Max888
  • 111
  • 2

1 Answers1

0

I believe your scenario should involve using Cloud Functions to host the code you want to execute and Cloud Pub/Sub and Cloud Scheduler in order to trigger it as explained in this article.

To sum up the article, you should:

  • Develop the code that queries the BigQuery View and dumps the result to Google Sheet.
  • Make a Cloud Function that triggers using Cloud Pub/Sub with the code you developed earlier. Create a new Pub/Sub topic for this task.
  • Create a Cloud Scheduler job with the frequency you need that targets the Pub/sub topic you created before. Take a look at this page if you want to nail the unix-cron format.

These should be all the steps.

Ajordat
  • 135
  • 5