Skip to main content
100%

Google Sheets Script for Fetching Data from Supabase

✓ Published0🌍 Public
HHugoberry
Last edited Apr 17, 2023
Created on May 29, 2024

This example shows a Google Sheets script that pulls data from a Supabase database and writes it into the active sheet, first clearing existing content. It uses the Supabase REST API via `UrlFetchApp.fetch` and handles JSON responses with `JSON.parse`. The script writes a configurable set of headers to row one, then maps each data row into corresponding columns. It relies on `SpreadsheetApp.getActiveSpreadsheet().getActiveSheet()` for sheet operations, and constants for the Supabase URL, anon key, and table name. The process is automated through a single `mainFunction` that chains clearing, header writing, and data fetching.

AI-generated description

Similar vizzes