function main() {
var ss = SpreadsheetApp.getActiveSheet();
var data = ss.getDataRange().getValues();
for (var i = 7; i < data.length; i++) {
var link = data[i][0];
}
}
=ARRAYFORMULA(REGEXEXTRACT(A2:A;".*?gclid=(.*)$"))
function run() {
const sheet = SpreadsheetApp.getActiveSpreadsheet()
.getSheetByName('Решение (скриптами)');
const range = sheet.getRange('A:A');
const values = range.getValues();
const data = values.map(row => {
const [undefined, value] = String(row[0]).split('gclid=');
return [value ?? ''];
});
range.setValues(data);
}