'How to retrieve data from Google Spreadsheet to Javascript or JSON?
This is public spreadsheet created using Google Drive: https://docs.google.com/spreadsheets/d/1hA4LKZn9yKoqnSzaI6_73GQSj_ZVpB3O0kC93QM98Vs/pubhtml
How to retrieve data from Google Spreadsheet to Javascript or JSON with new Google Spreadsheets API version 3.0 ?
Solution 1:[1]
If, alternatively, you want to keep it all in the Google environment. if you're looking for a more controlled JSON generator, check out this gist:
It takes in a Spreadsheet sheet and returns an array of objects, with the row that you decide as the key (defaults to whichever row is frozen)
Cheers,
Solution 2:[2]
I made it work using opensheet.
Steps:
- Make sure the sheet as read access - Anyone with the link can view it.
- Sheet should have First row as Header row with titles
- Then get the sheet data as json using the following link -
https://opensheet.elk.sh/spreadsheet_id/sheet_name - Replace
spreadsheet_idwith your sheet id andsheet_namewith your sheet name. No authentication is required.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Jorge Alcantara |
| Solution 2 | fingers10 |
