1
I am trying with the following code to take the URL of an entire row and store it in a "J" column if another "E" column contains some value, that is, it is not empty. The code executes, however, copies the URL ignoring whether the "E" column is empty or not. That is, whether this column has value or not, the URL is generated, as shown Where I am missing?
function geraURL() {
var spreadsheet = SpreadsheetApp.getActive();
for (var i=2; i<50;i++) {
if (spreadsheet.getRange('E'+i).activate()!= 0) {
spreadsheet.getRange('J'+i).activate();
spreadsheet.getCurrentCell().setValue('https://docs.google.com/spreadsheets/d/11LnRyO150lEMkDB-R7AoDHniP4sjUt4PiuLiH4/edit#gid=11393109881&range='+i+':'+i);
spreadsheet.getRange('J'+i).activate();
} else {
spreadsheet.getCurrentCell().setValue('');
}
}
}
It worked. Thank you.
– Rogér