0
votes

I have a time-based trigger that was created by a spreadsheet-bound script (lets call the spreadsheet “spreadsheet A“).

The trigger triggers a code from a function found in a library (lets call the function “lib function 1”), not from the spreadsheet-bound script of “spreadsheet A”).

In “lib function 1”- How can I get the container spreadsheet’s ID?

I really need it! :)

Thanks!

1
What have you already tried? - Cooper
I haven’t. I assume there is a way to either get the project or trigger ID and the container from there, but I haven’t found it. - Yaniv Aflalo
From the function in the library SpreadsheetA's id = SpreadsheetApp.getActive().getId(); - Cooper
Hi Cooper, thanks. However, the spreadsheet is not necessarily active when the trigger fires. - Yaniv Aflalo
I just set up a timebased trigger to a bound function which called the library function while the spreadsheet was off and the library function wrote some data which included the spreadsheets id to my spreadsheet. - Cooper

1 Answers

2
votes

I just set up a timebased trigger to a bound function which called the library function while the spreadsheet was off and the library function wrote some data which included the spreadsheets id to my spreadsheet.