What is an easy way to get Google Spreadsheet content as JSON using Google Apps Script?

What is an easy way to get the contents of a Google spreadsheet as JSON using Google Apps Script?

+3
source share
1 answer

In a Google spreadsheet, go to Tools > Scripts > Script Editor

Paste this code and click play

function getValues() {
  var range = SpreadsheetApp.getActiveSheet().getDataRange();
  var json = Utilities.jsonStringify(range.getValues())
  Browser.msgBox(json);
}​
+2
source

Source: https://habr.com/ru/post/1774224/


All Articles