Complete the code to create a new Google Sheet with a given title.
var spreadsheet = SpreadsheetApp.[1]('My New Sheet');
The create method creates a new spreadsheet with the given title.
Complete the code to open an existing spreadsheet by its ID.
var spreadsheet = SpreadsheetApp.[1]('1a2b3c4d5e6f7g8h9i0j');
The openById method opens an existing spreadsheet using its unique ID.
Fix the error in the code to open a spreadsheet by URL.
var spreadsheet = SpreadsheetApp.[1]('https://docs.google.com/spreadsheets/d/abc123xyz/edit');
The openByUrl method opens a spreadsheet using its full URL.
Fill both blanks to get the active spreadsheet and then get its first sheet.
var spreadsheet = SpreadsheetApp.[1](); var sheet = spreadsheet.[2]()[0];
getActiveSpreadsheet() gets the current spreadsheet, and getSheets() returns all sheets as an array. Accessing index 0 gets the first sheet.
Fill all three blanks to create a new spreadsheet, get its first sheet, and rename it.
var spreadsheet = SpreadsheetApp.[1]('Budget 2024'); var sheet = spreadsheet.[2]()[0]; sheet.[3]('January');
create makes a new spreadsheet, getSheets() returns all sheets, and setName() renames the sheet.