async function CitiesNovaPoshta () {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet1 = ss.getSheetByName('Города');
let x = 0;
var payload = {
'apiKey': '6bde07fde09a9f1d11b034df69403d73',
'modelName': 'Address',
'calledMethod': 'getCities',
}
var options = {
'method' : 'post',
'headers': {
'content-type': 'application/json',
},
'payload': JSON.stringify(payload),
};
while (x < 10) {
var result = await UrlFetchApp.fetch('https://api.novaposhta.ua/v2.0/json/', options);
if (result) {break;}
x++
};
var data = JSON.parse(result.getContentText());
// orderList = JSON.stringify(orderList, null, 2);
//Logger.log(orderList);
const lastRow = sheet1.getLastRow() + 1;
//return sheet
sheet1.getRange(lastRow, 1, lastRow + data.length, data[0].length)
sheet1.setValues(data);
};
'=A1000+B1000'
' = '
str
cell.setValue(str);
Что делать?