Google Apps Script Quiz 6

Google Apps Script Quiz 6

#GoogleAppsScript #GAS #automation #scripting #GoogleSheets #GoogleDocs #GoogleForms #add-ons #customfunctions #spreadsheetautomation #documentautomation #formautomation #appscript #productivitytools #coding #programming #google #workspace #gsuite

What is Apps Script?

Which of the following is not a trigger type in Apps Script?

Which method can be used to create a new menu in a Google Sheets spreadsheet?

What does the following code do? var sheet = SpreadsheetApp.getActiveSheet();

Which method can be used to insert a row into a Google Sheets spreadsheet?

What function can be used to concatenate two strings in Apps Script?

Which method can be used to copy a range of cells in a Google Sheets spreadsheet?

What is Apps Script?

a. A programming language used to create add-ons for Google Sheets, Docs, and Forms.

b. A mobile app development platform.

c. A web development framework.

d. A game engine for building mobile games.

Solution: a. A programming language used to create add-ons for Google Sheets, Docs, and Forms.

Explanation: Apps Script is a scripting language developed by Google that allows developers to create add-ons and automate tasks in Google Sheets, Docs, and Forms.

Which of the following is not a trigger type in Apps Script?

a. Time-driven

b. Form-submit

c. Spreadsheet-edit

d. Text-message

Solution: d. Text-message. Text-message is not a trigger type in Apps Script.

Explanation: Apps Script supports several trigger types, including time-driven triggers, form-submit triggers, spreadsheet-edit triggers, and many others. However, text-message triggers are not supported.

Which method can be used to create a new menu in a Google Sheets spreadsheet?

a. createMenu()

b. addMenu()

c. insertMenu()

d. all of the above

Solution: a. createMenu(). The createMenu() method can be used to create a new menu in a Google Sheets spreadsheet.

Explanation: The createMenu() method is used to create a new custom menu in a Google Sheets spreadsheet. The addMenu() and insertMenu() methods are not valid methods in Apps Script.

What does the following code do? var sheet = SpreadsheetApp.getActiveSheet();

a. Creates a new spreadsheet with one sheet named “Sheet1”.

b. Gets the active sheet in the current spreadsheet.

c. Gets the sheet named “Sheet1” in the current spreadsheet.

d. None of the above.

Solution: b. Gets the active sheet in the current spreadsheet.

Explanation: This code uses the getActiveSheet() method to get a reference to the active sheet in the current spreadsheet.

Which method can be used to insert a row into a Google Sheets spreadsheet?

a. insertRow()

b. addRow()

c. appendRow()

d. pushRow()

Solution: a. insertRow(). The insertRow() method can be used to insert a row into a Google Sheets spreadsheet.

Explanation: The insertRow() method is used to insert a new row at a specified index in a Google Sheets spreadsheet. The addRow() and appendRow() methods add a new row at the end of the sheet, and the pushRow() method is not a valid method in Apps Script.

What function can be used to concatenate two strings in Apps Script?

a. CONCATENATE()

b. CONCAT()

c. ADD()

d. JOIN()

Solution: b. CONCAT(). The CONCAT() function can be used to concatenate two strings in Apps Script.

Explanation: The CONCAT() function is used to combine two or more strings into a single string. The CONCATENATE() function is also available, but CONCAT() is recommended as it is simpler to use.

Which method can be used to copy a range of cells in a Google Sheets spreadsheet?

a. copy()

b. duplicate()

c. copyTo()

d. all of the above

Solution: c. copyTo(). The copyTo() method can be used to copy a range of cells in a Google Sheets spreadsheet.

Explanation: The copy() method creates a new copy of the range, but does not place it anywhere. The duplicate() method creates a new sheet with a duplicate of the range, but does not copy the range to an existing sheet. The copyTo() method copies the range to a new location in the same or another sheet.