I have a Google Form that is run on a script. Every Monday there is a trigger that happens at a specific time and what it does is it opens the sign ups and sets the destination to a new sheet in a linked spreadsheet.
I am now writing another script that will get the results from those sign ups and do something with that data. The thing is, I can't seem to figure out how to get the specific spreadsheet where the form is throwing data into.
Now if I do something like this:
var form = FormApp.getActiveForm();
var ss = SpreadsheetApp.openById(form.getDestinationId());
Logger.log(ss.getSheetName());
The output will be the name of the first sheet in that spreadsheet. While this may work for me 90% of the time, I do run a risk of somebody going and messing with the order of the sheets. For this reason, I need to retrieve the exact sheet where the form is sending data into. How can I do this?