Free guide + free tool

How to send Metabase results to Google Sheets automatically

Metabase can import Google Sheets, but it can't push a question's results back out to a Sheet on a schedule. Here's the manual way, and a free script that does it for you every hour or every morning.

Make a free copy ☕ Buy me a coffee

The manual way (fine for once in a while)

Open the question in Metabase, click the download icon, choose .csv, then in Google Sheets use File → Import → Upload and choose Replace current sheet. Newer Metabase versions can also copy results to your clipboard to paste into a Sheet. Either way, someone has to repeat it every time the numbers change.

The automatic way (free, about 5 minutes)

SheetRefresh is a small open-source script that lives inside your Google Sheet. Set it up once:

  1. Create a Metabase API key. In Metabase: Admin → Settings → Authentication → API Keys → Create. Give it a group that can only see the questions this Sheet needs.
  2. Make your own copy of the SheetRefresh Sheet. Click the button, then Make a copy. It lands in your Google Drive with the script already inside. Nobody else can see your copy.
  3. Open your copy. After a few seconds a SheetRefresh menu appears next to Help.
  4. Connect to Metabase. Click SheetRefresh → Connect to Metabase. Google asks you to approve access the first time. Because the script is your own copy, Google shows a "Google hasn't verified this app" screen: click Advanced → Go to SheetRefresh (unsafe), then Allow. The developer email on that screen is your own, because your copy belongs to you. Then enter your Metabase address and the API key.
  5. Add a question. Click SheetRefresh → Add a question, paste a question link (like https://yourcompany.metabaseapp.com/question/123), and name the tab it should fill.
  6. Refresh and schedule. Click SheetRefresh → Refresh all now to check it works, then Refresh every hour or Refresh every morning. It keeps running with your browser closed.
Want it in a Sheet you already have? Paste the script in yourself
  1. Open that Sheet and click Extensions → Apps Script. A code editor opens in a new tab.
  2. Click the button below, then in the editor select everything in Code.gs, paste over it, and click the Save icon.
  3. Reload the Sheet so the SheetRefresh menu appears, then follow steps 4–6 above. On Google's warning screen, the link says Go to Untitled project (unsafe) instead.

Prefer to read the code first? It's all on GitHub.

Why it works where other scripts break

Questions

What do I need?

A Metabase with API keys (Admin → Settings → Authentication → API Keys) that Google's servers can reach over the internet — Metabase Cloud, or self-hosted on a public address. Plus a Google account with Google Sheets.

My Metabase is behind a VPN or firewall. Will it work?

No. Google's servers make the request, so they need to reach your Metabase.

Is it really free?

Yes. The script is open source under the MIT license. If it saves you time, you can buy me a coffee, but you don't have to.

Where is my API key stored?

In your own Google account (Apps Script user properties), not in the Sheet's cells. Other editors of the Sheet don't see it, and the schedule runs as you.

How big can a refresh be?

Google Sheets holds up to 10 million cells per spreadsheet. It's built for reporting-sized results, not full table dumps.

Will there be a paid version?

Maybe: a one-click install, email alerts when a refresh fails, and filter values per question. The free script stays free. Email me if you want to hear when it's ready.

Questions or stuck?

Email me with what you tried and what the Status column says, and I'll help. Found a bug or want a feature? Open an issue on GitHub.

Saved you a Monday-morning CSV shuffle?

☕ Buy me a coffee