Whats an easy way to get the contents of a Google Spreadsheet as JSON using Google Apps Script?

StackOverflow https://stackoverflow.com/questions/4151397

سؤال

Whats an easy way to get the contents of a Google Spreadsheet as JSON using Google Apps Script?

هل كانت مفيدة؟

المحلول

In the Google Spreadsheet go to Tools > Scripts > Script Editor

Insert this code and hit the play button

function getValues() {
  var range = SpreadsheetApp.getActiveSheet().getDataRange();
  var json = Utilities.jsonStringify(range.getValues())
  Browser.msgBox(json);
}​
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top