Skip to content

Instantly share code, notes, and snippets.

0xfb27816c324bb208fe630f5272e95e2d7487e287
@al-codaio
al-codaio / coda_one_way_sync.js
Last active February 18, 2020 00:09
One-way data sync between Coda tables
CodaAPI.authenticate('abcd1234-efgh-5678-ijkl-1234mnop5678'); // Replace with your token.
SOURCE_TABLES = [
{
doc: 'TO UPDATE',
table: 'Source Table',
},
// Add more as needed.
];
TARGET_TABLE = {
@al-codaio
al-codaio / coda_one_way_sync_v2.js
Last active June 5, 2020 22:59
One-way data sync between Coda tables with delete
// Setup and global variables
CodaAPI.authenticate('TO UPDATE');
SOURCE_DOC_ID = 'TO UPDATE'
TARGET_DOC_ID = 'TO UPDATE'
TARGET_TABLE_SOURCE_ROW_COLUMN = 'Source Row URL';
/////////////////////// Define tables to sync between source and target docs below //////////////////////////////////
var TABLES = [
@al-codaio
al-codaio / google_sheets_one_way_sync.js
Created May 20, 2019 16:34
One-way data sync between Google Sheets files
var sourceSpreadsheetID = "TO UPDATE";
var sourceWorksheetName = "TO UPDATE";
var targetSpreadsheetID = "TO UPDATE";
var targetWorksheetName = "TO UPDATE";
function importData() {
var thisSpreadsheet = SpreadsheetApp.openById(sourceSpreadsheetID);
var thisWorksheet = thisSpreadsheet.getSheetByName(sourceWorksheetName);
var thisData = thisWorksheet.getDataRange();
//Uncomment line 11 below and comment out line 9 if you want to sync a named range. Replace "teamBugs" with your named range.
@al-codaio
al-codaio / coda_google_sheets_one_way_sync.js
Last active November 7, 2022 03:30
One-way data sync from a Coda table to a worksheet in Google Sheets (Google Apps Script)
// One-way data sync from Coda to Google Sheets using Google Apps Script
// Author: Al Chen ([email protected])
// Last Updated: July 16, 2020
// Notes: Assumes you are using the V8 runtime (https://developers.google.com/apps-script/guides/v8-runtime)
// Coda's library for Google Apps Script: 15IQuWOk8MqT50FDWomh57UqWGH23gjsWVWYFms3ton6L-UHmefYHS9Vl
//////////////// Setup and global variables ////////////////////////////////
CodaAPI.authenticate('YOUR_API_KEY')
SOURCE_DOC_ID = 'YOUR_SOURCE_DOC_ID'
@al-codaio
al-codaio / google_sheets_coda_one_way_sync.js
Last active July 16, 2020 20:32
One-way data sync from Google Sheets to a table in Coda (Google Apps Script)
// One-way data sync from Google Sheets to Coda using Google Apps Script
// Author: Al Chen ([email protected])
// Last Updated: July 16, 2020
// Notes: Assumes you are using the V8 runtime (https://developers.google.com/apps-script/guides/v8-runtime)
// Coda's library for Google Apps Script: 15IQuWOk8MqT50FDWomh57UqWGH23gjsWVWYFms3ton6L-UHmefYHS9Vl
//////////////// Setup and global variables ////////////////////////////////
CodaAPI.authenticate('YOUR_API_KEY')
@al-codaio
al-codaio / google_doc_to_coda_one_way_sync.js
Last active August 28, 2020 13:01
Takes all your Google Docs in a Google Drive folder, takes the first table in each Google Doc, and syncs that data to a table in Coda.
// Google Apps Script for one-way data sync from a table in a Google Doc to Coda table from multiple Google Docs in a Google Drive folder
// Author: Al Chen ([email protected])
// Last Updated: August 6th, 2020
// Notes: Assumes you are using the V8 runtime (https://developers.google.com/apps-script/guides/v8-runtime)
// Coda's library for Google Apps Script: 15IQuWOk8MqT50FDWomh57UqWGH23gjsWVWYFms3ton6L-UHmefYHS9Vl
//////////////// Setup and global variables ////////////////////////////////
CodaAPI.authenticate('YOUR_API_KEY')
@al-codaio
al-codaio / msexcel_fill_values_down.vba
Last active August 5, 2024 21:35
Fill cell value down until a new cell value occurs - VBA script for Microsoft Excel
' VBA script to take a value in column A and fill it down until a new value shows up in a cell for Microsoft Excel
' Author: Al Chen ([email protected])
' Last Updated: September 6th, 2020
' Video tutorial: https://youtu.be/t-32QkyjKVE?t=1109
Sub fillValuesDown()
Dim lastRow As Double
lastRow = ActiveSheet.Cells(Rows.Count, "B").End(xlUp).Row
Dim currentRange As Variant: Set currentRange = ActiveSheet.Range("A2:A" & lastRow)
ReDim newRange(1 To lastRow)
@al-codaio
al-codaio / google_sheets_fill_values_down.js
Last active August 5, 2024 21:34
Fill cell value down until a new cell value occurs - Google Apps Script for Google Sheets
// Google Apps Script to take a value in column A and fill it down until a new value shows up in a cell for Google Sheets
// Author: Al Chen ([email protected])
// Last Updated: September 6th, 2020
// Video tutorial: https://youtu.be/t-32QkyjKVE?t=106
function fillValuesDown() {
var spreadsheet = SpreadsheetApp.getActive()
var currentRange = spreadsheet.getRange("A2:A" + spreadsheet.getLastRow())
var newRange = []
var newFillValue
@al-codaio
al-codaio / peloton_coda_sync.py
Last active January 21, 2021 17:42
Python script to sync Peloton workout data to a table in a Coda doc
# One-way data sync from Peloton API to Coda in Python
# Author: Al Chen ([email protected])
# Last Updated: January 21st, 2021
# Writeup and copyable template here: https://coda.io/@atc/analyze-your-peloton-workout-stats-with-real-time-updates
################# Setup and global variables ###########
api_key = 'YOUR_CODA_API_KEY'
coda_doc_id = 'YOUR_CODA_DOC_ID'
peloton_username = 'YOUR_PELOTON_USERNAME'