Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function writeFormTitle(){
- //Get Form
- var form = FormApp.getActiveForm();
- //Get Form's Title
- var formTitle = form.getTitle();
- //Get the Write To Spreadsheet ID where the data will be written to
- var destinationSpreadsheet = form.getDestinationId();
- //Activate that Spreadsheet by the destinationSpreadsheet ID
- var sheet = SpreadsheetApp.openById(destinationSpreadsheet).getActiveSheet();
- //Find the last column and row
- var writeToColumn = sheet.getLastColumn()+1;
- var writeToRow = sheet.getLastRow();
- //Write title to Spreadsheet next to submitted data.
- sheet.getRange(writeToRow, writeToColumn, 1, 1).setValue(formTitle);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement