This code is taken from DJ's Weblog, thanks a lot for this!
- You'll need the key of your spreadsheet, the url format should be like this:
https://docs.google.com/spreadsheet/ccc?key=**YOUR-KEY-HERE**=drive_web#gid=0
and also the sheet number (i.e., Sheet 1). - In your document file menu, you'll find File Menu > Tools > Script Editor (you will be redirected to Google's script editor.
- Create a new Script file, and paste the content of the
SheetAsJSON.js
to the editor stage, and save it. - On the file menu, go to Publish > Deploy as Web App and make sure that you set the opions
Execute app as: User Accessing the web app
and the other option toWho has access to the web app: anyone
and update. - Now, to use the script/web app you may use the web app like this:
https://script.google.com/macros/s/AKfycbxOLElujQcy1-ZUer1KgEvK16gkTLUqYftApjNCM_IRTL3HSuDk/exec?id=YOUR=SPREADSHEET-KEY&sheet=YOUR-SHEET-NUMBER
suppose it returns sheet name eg, "Sheet" but in why mine is "records" ?