Mirror a Metabase question into Google Sheets on a schedule
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.
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.
Additional information
What does this prompt do?
- Runs a Metabase saved question on a schedule you choose (defaults to every hour during business hours).
- Wipes the destination tab in your Google Sheet so old rows never linger, then writes the fresh results back with a header row.
- Hands your team a Sheet they can pivot, chart, and share, always backed by the latest numbers from Metabase.
- Stays fully deterministic with no AI in the loop, so the Sheet is a true mirror of what the question returns.
What do I need to use this?
- A Metabase account with permission to view the saved question you want to sync.
- A Google account that can edit the destination spreadsheet.
- The ID of the Metabase question, plus the spreadsheet and tab name you want it written into.
How can I customize it?
- Change the schedule: hourly during business hours, every fifteen minutes, once a day before the morning stand-up, whatever cadence the team needs.
- Point it at a different question or a different tab by swapping the saved question ID or the sheet name.
- Add filters in Metabase (date range, region, product line) and the Sheet will mirror whatever the question returns.
Frequently asked questions
Do I need to be on a paid Metabase plan?
Will it overwrite formatting or formulas in my Google Sheet?
What if my question returns thousands of rows?
Can I sync more than one question into the same spreadsheet?
How fresh will the Sheet be?
Stop exporting Metabase to CSV every morning.
Connect Metabase and Google Sheets once, pick a question, and Geni keeps the Sheet in sync on whatever schedule you want.