Skip to content

Instantly share code, notes, and snippets.

@kbk0125
Created April 17, 2016 19:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kbk0125/8ebb1c4ab9053a8bcb6103c6489d1b6d to your computer and use it in GitHub Desktop.
Save kbk0125/8ebb1c4ab9053a8bcb6103c6489d1b6d to your computer and use it in GitHub Desktop.
//Blockspring APIs take in data as if it was from a spreadsheet. Needs nested arrays
//Like this: [[row1val1, row1val2],[row2val1, row2val2]...]
//Example from Blockspring site
var orig = "[[\"name\",\"random number\"],[\"Jason\",\"150\"],[\"Don\",\"250\"],[\"Paul\",\"50\"]]"
//Add values to sheet
blockspring.runParsed("append-to-google-spreadsheet", {
//middle parameter from Google Spreadhseet URL
//https://docs.google.com/spreadsheets/d/FILE_ID/edit?usp=sharing
"file_id": 'YOURIDHERE',
// The first sheet within the particular doc will always be 0
"worksheet_id": 0,
//The array of arrays, as stated above
"values": allData},
//Provided on the page at https://open.blockspring.com/pkpp1233/append-to-google-spreadsheet
{ "api_key": "YOURAPIKEYHERE" },
function(res){
//console.log to check for errors
console.log(res);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment