Now I am using this to get the data from sheet.
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)
});
And as a result I am getting an array of values - rows.
[Row Name1,Row Name2,Row Name3,],
[val11, val12, val13],
[val21, val22, val23],
[val31, val32, val33]
Is there a way to get this as key->value json? Like this one:
{
"Row Name1":"val11",
"Row Name2":"val12",
...
},
{
"Row Name1":"val21",
"Row Name2":"val22",
...
},
Thanks