Aim of the puzzle: Use Apps Script to write a function that creates a copy of a contract document from Docs, renames the copy, and returns its id.
Walk through of the solution: For the last topic of this course, you’ll use Apps Script to create a function that automates the process of creating contracts.
In this puzzle, you’ll write the 1st of two helper functions that will be used later in the main function. The function should create a copy of a contract document from Docs, rename the copy, and return its id.
In the code that you start off with, the
makeCopy helper function takes an
id, and a
To complete the puzzle, create a variable called
file that stores the file retrieved using
DriveApp.getFileById(id). Then, create another variable called
copy that stores a copy of
file.makeCopy(name). Finally, add a return statement that returns the id of copy using
Apps Script concepts: