I’m trying to create a script that will trigger whenever a new row is added to my sheet, and add a text to column f in the new row only. I have the following script, but it didn’t work. Would love your help. Thanks so much!
function myFunction(e) {
var sh = SpreadsheetApp.getActiveSheet();
if(e.changeType === 'INSERT_ROW') {
var row = sh.getActiveRange().getRow();
sh.getRange(row, 6).setValue('defaultValue')
}
}
>Solution :
The code is excellent, I was able to make it work, however I notice that in order to make it work you need to make sure to add a trigger.
In this case "onChange". On App Script Make sure to go add a trigger for this function to work over the spreadsheet