How to import JSON data to a Google Sheet

The Google Sheets integration makes it easy for you to visualize data you have stored in Google Sheets. 

It has quickly become one of Databox's most popular integrations. One of the reasons for this is that Google makes it relatively easy to sync data from other platform's APIs into a Sheet.

Thanks to generous developers posting code samples online, you only need to make minor edits to this code, so it's syncing the appropritate data.

In order to import JSON data to Google Sheets, follow the steps below.

  1. Create a new Google Sheet
     
  2. Select Extensions >  Apps Script
     
  3. Delete the placeholder content
     
  4. Copy and paste the code from this script to the Script Editor
  5. Select File > Save

  6. Name your code "ImportJSON"

  7. Close the Script Editor and navigate back to your Google Sheet

     
  8. In cell A1, type ImportJSON("xxx"). Replace xxx with your API endpoint (be sure to keep the quotes and parenthesis) 
     
  9. Press enter. Your Google Sheet should now populate with your JSON data