Mirror a Metabase question into Google Sheets on a schedule

By General Input

Keep a Google Sheet in lockstep with the latest results of a Metabase saved question so finance and ops can pivot the numbers without leaving Sheets.

Integrations

  • Metabase
  • Google Sheets

Type

Deterministic Code

Categories

  • Operations
  • Finance

Build a code workflow that mirrors the results of a Metabase saved question into a Google Sheet on a recurring schedule, so finance and ops teams can pivot the numbers in Sheets without leaving their workflow.

Trigger: cron. Default cadence: every hour from 8am to 6pm on weekdays in the user's local timezone. Make the cron expression a configurable input so the user can change it (every 15 minutes, daily at 7am, etc.).

Configurable inputs (set once, reused on every run):

- Metabase card ID (the saved question to run)

- Google Sheets spreadsheet ID

- Destination sheet/tab name (e.g. "Metabase Mirror")

Pipeline (deterministic, no AI, no judgement):

1. Call Metabase Run Card Query with the configured card ID. Capture both the result rows and the column metadata from the response so we can build a header row.

2. Build a header row from the column display names (in the order Metabase returns them), and build the body rows from the result data in the same column order. Coerce values to strings/numbers that Google Sheets can store directly.

3. Call Google Sheets Clear Values on the destination tab to wipe any stale rows from the previous run. Use a range that covers the whole tab (e.g. the tab name with no cell range, which clears the entire sheet).

4. Call Google Sheets Append Values with the header row followed by the data rows, writing into the same tab. Use USER_ENTERED so numbers and dates render naturally.

Behaviour requirements:

- Every run produces a full refresh: clear then append, no diffing, no incremental updates.

- If the Metabase query fails or returns an error payload, stop before touching the Sheet so we never blank out the tab without writing new data.

- Log the row count written on each run so the user can confirm the sync ran.

- Do not touch any tab other than the configured destination tab.

Integrations to use: Metabase (Run Card Query) and Google Sheets (Clear Values, then Append Values). Nothing else.

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 engineerStop 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 LoopsTurn the people who engage with your posts into Pipedrive leads