Skip to content

Instantly share code, notes, and snippets.

@kbk0125
Created April 17, 2016 19:16
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/904c32c27e97a5454e05a43f70f6a2a4 to your computer and use it in GitHub Desktop.
Save kbk0125/904c32c27e97a5454e05a43f70f6a2a4 to your computer and use it in GitHub Desktop.
// First line of function
blockspring.runParsed("query-google-spreadsheet", {
// Here is where you need to decide what data you are grabbing with the Google query syntax
// I am finding elements that match the variable num, which is from a previous part of the code
// Google syntax makes you request columns with letters as opposed to your column titles.
"query": "SELECT A, C WHERE B ="+num,
// This is the full URL of your sheet. Just copy and paste from your browser.
"url": "YOURURLHERE"
//Cache is false so that your browser does not run an old function when you cnange your code
}, { cache: false, expiry: 7200}, function(res) {
// All results are part of the res.params.data object.
// in my case, I requested two columns from my spreadsheet, one named skill and one named key.
//There is one matching row in this case, with two elements
var skill=res.params.data[0]['skill'];
var key=res.params.data[0]['key'];
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment