I'm having trouble setting the sheet title to match the name of the form I've connected with this code. Despite confirming that the sheet's name is "Form Responses 1", the code keeps returning "null". Any advice?
var data = SpreadsheetApp.create('C Term 2017 Unit 0');
var idlog = data.getId();
var title = 'RST.5';
for (i = 1; i <= 7; i++) {
var dataset = SpreadsheetApp.openById(idlog);
var sname = ('Form Responses ' + i);
var active = dataset.getSheetByName(sname);
active.setName(title);
}
Any suggestions are greatly appreciated!