![](/img/trans.png)
[英]How do I get arrays mapped in a row in google sheet using JavaScript/Google App script
[英]How can I get the json format of my google sheet in google app script?
我正在嘗試獲取我的谷歌表格的 json 格式。 我嘗試了很多教程,但它不起作用。
這個怎么樣:
function shjsn() {
const ss=SpreadsheetApp.getActive();
const sh=ss.getSheetByName('SheetName');
const vs=sh.getDataRange().getValues();
return JSON.stringify(vs);
}
或者也許對於整個電子表格:
function ssjsn() {
const ss=SpreadsheetApp.getActive();
const shts=ss.getSheets();
let vs=[];
shts.forEach(function(sh,i){vs.push(sh.getDataRange().getValues());});
return JSON.stringify(vs);
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.