I have a standalone script with the following code:
var key = "ID of the Sheet";
function createTriggers() {
ScriptApp.newTrigger('filter')
.forSpreadsheet(key)
.onEdit()
.create();
}
function filter(){
var ss = SpreadsheetApp.openById(key);
// rest of the function below
}
This has 3 parts - The key of the Google spreadsheet the script is connected to, the trigger creation function of the spreadsheet and the function.
I need this script to be connected to multiple sheets. As of now, I am creating individual standalone script for each sheet.
How to have multiple sheets connected to the same standalone script when the code is in the above format?
If we cannot have multiple sheets connected to this script, is there any other way that's better than creating a standalone scripts for each and every sheet?