使用Google Apps脚本获取Google Spreadsheet内容为JSON的简单方法是什么? [英] Whats an easy way to get the contents of a Google Spreadsheet as JSON using Google Apps Script?

查看:249
本文介绍了使用Google Apps脚本获取Google Spreadsheet内容为JSON的简单方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Google Apps脚本获取Google Spreadsheet内容为JSON的简单方法是什么?

电子表格转至工具>脚本>脚本编辑器



插入此代码并点击播放按钮

  function getValues(){
var range = SpreadsheetApp.getActiveSheet()。getDataRange();
var json = Utilities.jsonStringify(range.getValues())
Browser.msgBox(json);
}


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);
}​

这篇关于使用Google Apps脚本获取Google Spreadsheet内容为JSON的简单方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆