Это то, что вы ищете?
function myFunction() {
const js='{"2020-05-05": {"downloads": 43,"re_downloads": 8,"uninstalls": 18,"updates": 192,"returns": 0,"net_downloads": 43,"date": "2020-05-05" }, "2020-05-06": {"downloads": 45,"re_downloads": 7,"uninstalls": 0,"updates": 196,"returns": 0,"net_downloads": 45,"date": "2020-05-06" }}';
const data=JSON.parse(js);
const sh=SpreadsheetApp.getActiveSheet();
var oA=Object.keys(data);
var vA=[];
//var html="";
oA.forEach(function(key){
var kA=Object.keys(data[key]);
var nA=new Array(kA.length-1);
vA.push([key].concat(nA));
vA.push(kA);
//html+=Utilities.formatString('<br /><strong>%s</strong>',key);
var row=[];
kA.forEach(function(e){
//html+=Utilities.formatString('<br />data[%s][%s]= %s',key,e,data[key][e]);
row.push(data[key][e]);
});
vA.push(row);
//html+='<hr>';
});
//SpreadsheetApp.getUi().showModelessDialog(HtmlService.createHtmlOutput(html), "Test");
sh.clear();
sh.getRange(1,1,vA.length,vA[0].length).setValues(vA);
}
Это, вероятно, более стандартный подход. Функция с парочкой настроек.
function myFunction() {
const js='{"2020-05-05": {"downloads": 43,"re_downloads": 8,"uninstalls": 18,"updates": 192,"returns": 0,"net_downloads": 43,"date": "2020-05-05" }, "2020-05-06": {"downloads": 45,"re_downloads": 7,"uninstalls": 0,"updates": 196,"returns": 0,"net_downloads": 45,"date": "2020-05-06" }}';
const data=JSON.parse(js);
const sh=SpreadsheetApp.getActiveSheet();
var oA=Object.keys(data);
var vA=[];
//var html="";
oA.forEach(function(key,i){
var kA=Object.keys(data[key]);
var nA=new Array(kA.length-1);
//vA.push([key].concat(nA));
if(i==0)vA.push(kA);
//html+=Utilities.formatString('<br /><strong>%s</strong>',key);
var row=[];
kA.forEach(function(e){
//html+=Utilities.formatString('<br />data[%s][%s]= %s',key,e,data[key][e]);
row.push(data[key][e]);
});
vA.push(row);
//html+='<hr>';
});
//SpreadsheetApp.getUi().showModelessDialog(HtmlService.createHtmlOutput(html), "Test")
sh.clear();
sh.getRange(1,1,vA.length,vA[0].length).setValues(vA);
}