Monday, June 18, 2012

Returning JSON From Google Spreadsheet Using jQuery

The ability to return the data in a Google Spreadsheet in JSON format is powerful. Unfortunately, I tend to forget how to do this. I have to spend too much time searching in order to figure it out. So, I thought I would write this up as a reminder for myself.

First off, any spreadsheet that will be returning JSON data needs to have been made public. This is not a hard process. The instruction can be found here.

Here is an example for returning the data from spreadsheet with the key 0Ak1itrncGIGldHNvZk9tUkhBWFJ5LXlhekxfcF9yTHc

JSON from sheet 1

Here is the code for returning the data above.

In order to do the same for your spreadsheets, just change the key so that it points to the proper workbook and the sheet reference ("od6" in the example above) to the desired sheet.

No comments:

Post a Comment