coda-google-apps-script
Scripts for syncing data to and from Coda and Google Sheets
AI Summary
Coda-Google Sheets Sync GAS
GAS scripts for one-way data sync between Coda and Google Sheets.
Target Users
Beginner to intermediate GAS developers needing to sync row add/delete/update between Coda and Sheets.
Problems Solved
Lack of simple GAS scripts to add, delete, update rows between Coda docs and Google Sheets.
Script ID
- In GAS Editor: Click "Libraries +" → Paste into "Script ID" field → Click "Look up"
- "coda-google-apps-script" will appear in the search results
- Select the latest version (highest number) from "Version" dropdown
- Click "Add"
Tags
Main Features
1
4 Sync Types
Supports coda-to-coda, sheets-to-sheets, coda-to-sheets, sheets-to-coda patterns.
2
Easy Setup
Configure API key, doc ID, table ID at script top.
3
Auto Triggers
Time-driven triggers enable auto-sync every minute, hour, or day.
Examples
Main Functions
| Function | Description |
|---|---|
| runSync | Execute data sync |
Examples
Coda to Sheets Sync Setup
/**
* CodaからGoogle Sheetsへの同期設定
* ・APIキー設定: YOUR_API_KEY = 'your_coda_api_token';
* ・ソースDoc/テーブルID設定: YOUR_SOURCE_DOC_ID = 'doc_id'; YOUR_SOURCE_TABLE_ID = 'table_id';
* ・ターゲットSheets設定: YOUR_GOOGLE_SHEETS_ID = 'sheets_id'; YOUR_GOOGLE_SHEETS_WORKSHEET_NAME = 'Sheet1';
*/
const YOUR_API_KEY = 'your_coda_api_token';
const YOUR_SOURCE_DOC_ID = 'doc_id_after_d';
const YOUR_SOURCE_TABLE_ID = 'table_id_from_coda';
const YOUR_GOOGLE_SHEETS_ID = 'sheets_id_after_d';
const YOUR_GOOGLE_SHEETS_WORKSHEET_NAME = 'Your Worksheet';
const YOUR_SOURCE_ROW_URL_COLUMN_NAME = 'Coda Source Row URL';
// スクリプト全体貼り付け後、runSyncを選択して実行Sheets to Coda Sync Setup
/**
* Google SheetsからCodaへの同期設定
* ・APIキー・ターゲットDoc/テーブルID設定: YOUR_API_KEY, YOUR_TARGET_DOC_ID = '...'; YOUR_TARGET_TABLE_ID = '...';
* ・ソースSheets設定: YOUR_GOOGLE_SHEETS_ID = '...'; YOUR_GOOGLE_SHEETS_WORKSHEET_NAME = '...';
* ・追加オプション: DO_NOT_DELETE_COLUMN = 'Do not delete'; REWRITE_CODA_TABLE = true;
*/
const YOUR_API_KEY = 'your_coda_api_token';
const YOUR_TARGET_DOC_ID = 'target_doc_id';
const YOUR_TARGET_TABLE_ID = 'target_table_id';
const YOUR_GOOGLE_SHEETS_ID = 'source_sheets_id';
const YOUR_GOOGLE_SHEETS_WORKSHEET_NAME = 'Your Worksheet';
const YOUR_SOURCE_ROW_URL_COLUMN_NAME = 'Coda Source Row URL';
const DO_NOT_DELETE_COLUMN = 'Do not delete';
const REWRITE_CODA_TABLE = false;
// スクリプト全体貼り付け後、runSyncを選択して実行
runSync();