


The one caveat is that when you re-open the spreadsheet, it might take a few seconds for the Export JSON menu to appear. Even better, you can close the spreadsheet, come back to it later, add more data, and export it as JSON (the Apps Script remains associated with the spreadsheet). So you could build your data, export it to JSON, come back to the spreadsheet, add more data, and again export it to JSON and the new data will be included. One of the nice things about this script is that it allows you to keep adding to the spreadsheet. Once it’s saved, click the Run button ( Figure 1).įigure 4: Our Rush discography has been converted to a handy JSON format.Ĭopy and paste the output in the pop-up and use it wherever you need that JSON-formatted code. Next, click the Save button to save your work so far.

In the resulting window, paste the following script found in this Gist.Īfter pasting the script, click Untitled Document and then name it something like JSON EXPORT. To do this, click Extensions > Apps Script. Okay, now that you’ve added your data into the spreadsheet, the next step is to create an Apps Script, a Google Cloud JavaScript tool to integrate and automate tasks. If you don’t do this, the export will error out. So after crafting your spreadsheet, select the top row and then click View > Freeze > 1 Row. But once you’ve created your spreadsheet, it’s crucial that you freeze the title row. You can create a Sheets doc that contains any type of data.
