【发布时间】:2017-08-04 17:07:31
【问题描述】:
现在我正在使用它从工作表中获取数据。
fetch('https://sheets.googleapis.com/v4/spreadsheets/DOC_ID/values/!A2:Z999?key=API_KEY')
.then(function(response) {
return response.json();
}).then(function(json) {
console.log(json)
});
因此,我得到了一个值数组 - 行。
[Row Name1,Row Name2,Row Name3,],
[val11, val12, val13],
[val21, val22, val23],
[val31, val32, val33]
有没有办法把它作为 key->value json?喜欢这个:
{
"Row Name1":"val11",
"Row Name2":"val12",
...
},
{
"Row Name1":"val21",
"Row Name2":"val22",
...
},
谢谢
【问题讨论】:
标签: json google-sheets google-spreadsheet-api