I'm noob in Google Apps Script (GAS) & intensively reading & trying out appropriate docs. I'm writing here in hope that someone already knows the answers to my question. Below GAS returns error on "ReferenceError: spreadsheetId is not defined".
Question: anyone knows how to get spreadsheetId in the GAS?
function myFunction() {
var sheet = Sheets.newSpreadsheet();
var title = 'title';
sheet.properties = Sheets.newSpreadsheetProperties();
sheet.properties.title = title;
var spreadsheet = Sheets.Spreadsheets.create(sheet);
}
function writeToSheet() {
var values = [
[
// Cell values ...
]
// Additional rows ...
];
var valueRange = Sheets.newValueRange();
valueRange.values = values;
var result = Sheets.Spreadsheets.Values.update(valueRange, spreadsheetId, range, {
valueInputOption: valueInputOption
});
}