Google Sheet Renaming via App Script

Job ID: 37724703

Budget: $10 – $30 USD

I need to programmatically rename a Google sheet using a Google App script.


The non-functioning code is:


// Step 5: Rename the copied Verkflo (DOESNT WORK!!!)
var CurrentName = templateFile.getName();
var newName = CurrentName.replace(SpreadsheetApp.getActiveSpreadsheet().getRange("G8").getValue());
copiedFile.setName(newName);

Replace it with a working script.

The script must rename the Google sheet using the client's name to be pulled from Cell G8 of the Spreadsheet, joined by its original filename including its date.

For example:

The spreadsheet is called Verkflo 3-2-2024 (the date 3-2-2024 is the sheets version)

Re-name it using the content of Cell G8 of the Sheet - "Joe Bloggs - Writ - 3 February 2024 - 3-2-2024"

Thats it!
Related categories: Google App Engine Software Testing