All I need is to execute a piece of code on the row that has just been added, I’m trying to get the active workbook by using the following code but the result is null. How do I refer in a script to newly added row?
var workbook = SpreadsheetApp.getActiveSpreadsheet();
Are you using onChange, or calling a script from a Bot-Task, or something else?
1 Like
Hi Marc - it’s a bot - it triggers on a newly added row and calls a stand-alone app script.
If it’s a stand-alone script, there is never an active sheet, you have to use SpreadsheetApp.openById()
2 Likes