Nightly Looker report snapshot into a Google Sheets log

By General Input

Every night we run your saved Looker report, stamp each row with the date, and append it to a Google Sheet so you keep the history Looker overwrites.

Integrations

  • Looker
  • Google Sheets

Type

Deterministic Code

Categories

  • Operations

Every night at 11pm, take a snapshot of one saved Looker Look and append its rows to a Google Sheets tab, so I build up a historical record that Looker itself does not retain once the underlying data is overwritten. This is a straight deterministic copy. Run the Look, stamp the date, append the rows. No summarizing, no filtering, no interpretation of the values.

Trigger: cron, every day at 23:00 in my timezone.

Step one, run the Look. Use the Looker Run Look operation with the json result format, passing the Look ID I configure. Looker returns ids as strings even when they look numeric, so treat every returned value as text and do not coerce types. If the Look returns more rows than a single page, page through using limit and offset, adding limit to offset until a short or empty page comes back, and collect all rows before writing anything. If the Look returns zero rows, end the run without touching the spreadsheet.

Step two, stamp the run date. Prepend a single Run Date column to every row, holding the date the workflow ran in YYYY-MM-DD format. This date column is the entire point of the workflow: it is what turns a series of identical-looking snapshots into a usable time series.

Step three, pick the quarterly tab. Derive the tab name from the run date using the pattern Snapshot YYYY-Qn, for example Snapshot 2026-Q3. Read the spreadsheet's existing tab names with the Google Sheets Get Spreadsheet operation. If the tab for the current quarter does not exist yet, create it with Batch Update Spreadsheet and write a header row first: Run Date, followed by the Look's field labels in the exact order Looker returned them.

Step four, append the rows. Use the Google Sheets Append Values operation against the current quarter's tab, which appends after the last row of the detected table. Column order is fixed and must never shift: Run Date first, then the Look's columns in the order established by that tab's header row. If a field the header expects is missing from a given row, write an empty cell rather than shifting the remaining values left. If the Look gains new fields mid-quarter, keep writing into the existing header order for the current tab; the next quarter's new tab will pick up the new shape. Send values as raw text so dates and ids are not reinterpreted by the spreadsheet, and split large result sets into batches of a few hundred rows per append call to stay well under the Sheets request size limit.

Make these configurable at the top of the workflow: the Looker Look ID, the destination spreadsheet ID, the tab name prefix, the rollover period (quarterly by default), and the timezone the schedule and date stamp use.

Related prompts

Explore more prompts
Call overdue Xero customers with an AI collections agentLocal listing health board for every location you manageLet support send one-off Loops emails without an engineerClean out the Looker dashboards and Looks nobody opensStop cold emails to anyone with a live deal in PipedriveiMessage campaign console with pre-flight checks and delivery boardLinkedIn Ads budget pacing dashboard for every client accountFront desk appointment confirmation board for the next 3 daysGive your team Looker numbers without buying more seatsBuild audience segments from product usage and push to Loops