v
Чтобы все работало: скопируйте Таблицу и положите функцию
go
на триггер на редактирование таблицы.https://docs.google.com/spreadsheets/d/1phUHC8VGmPld8T9hYZXy8LL0U98yVR6JyViXxiEAUOE/edit?usp=sharing
Код
function go(e){
var ss = e.source;
var sheet = ss.getActiveSheet();
var r = e.range;
var v = e.value;
if(r.getColumn() == 1 && sheet.getName() == 'Лист1' && v == 'TRUE'){
var url = r.offset(0, 1).getValue();
r.offset(0, 2).setValue(getResponseCode(url));
}
}
function getResponseCode(h){
return UrlFetchApp.fetch(h, {muteHttpExceptions: true }).getResponseCode();
}