Title: Google Apps Script for exporting CSV files from the Fulcrum Query API to a Drive folder
Notes: Be sure to manually run the exportData() function at least once to authorize the script. Set a timed trigger to automate exports.
Author: Bryan R. McBride
var fulcrumToken = "abcdefghijklmnopqrstuvwxyz";
var fulcrumFormName = "My App";
var filesFolder = "1_NGfsxszanv2evVJgfKMXxmU54SZ92FW";
Title: Google Apps Script for importing CSV files from Drive into Fulcrum
Notes: Be sure to manually run the getFiles() function at least once to authorize the script. Set a timed trigger to automate imports.
Author: Bryan R. McBride
--CSV file format--
27.770787,-82.638039,Building 1,red
var fulcrumToken = "abcdefghijklmnopqrstuvwxyz";
View apbp_karner_barrens.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View osgb.js
* GeoTools javascript coordinate transformations
* This file copyright (c)2005 Paul Dixon (
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
View gdal_geotiff_to_mbtiles.txt
gdal_translate image.tif image.mbtiles -of MBTILES
gdaladdo image.mbtiles 2 4 8
curl "{token}.geojson" > records.geojson
ogr2ogr -f "ESRI Shapefile" records.shp records.geojson
View thumbnail.sql
SELECT *, CASE WHEN photos != '' THEN left(photos_url, position('/view' in photos_url)) || split_part(photos, ',', 1) || '/thumbnail.jpg' ELSE photos END AS thumbnail FROM my_fulcrum_table

Wiring up a Google Form to GitHub is not that difficult with a little bit of Apps Script automation. All you need is a Google account, a GitHub account, and a web browser...

Set up your GitHub Personal Access Token

Personal access tokens provide an easy way to interact with the GitHub API without having to mess with OAuth. If you don't already have a personal access token with repo or public_repo access, visit your GitHub settings page and generate a new token.

Be sure to copy your token some place safe and keep it secure. Once generated, you will not be able to view or copy the token again.

Set up the Form & Spreadsheet

  1. Create a Google Form.
View polygon_insert.sql
-- Create a function withn the security set to Definer so that it can insert
CREATE OR REPLACE FUNCTION AXH_NewMinneapolis(integer, geometry) RETURNS integer
AS 'INSERT INTO minneapolis (parent_id, the_geom) (SELECT id, geom FROM (SELECT $1 id,$2 geom) a WHERE ST_NPoints(geom) < 100) RETURNING cartodb_id;'
--Grant access to the public user
GRANT EXECUTE ON FUNCTION AXH_NewMinneapolis(integer, geometry) TO publicuser;
View fulcrum-topojson.js
Copyright (c) 2012, Michael Bostock
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.