Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. function writeFormTitle(){
  2. //Get Form
  3. var form = FormApp.getActiveForm();
  4.  
  5. //Get Form's Title
  6. var formTitle = form.getTitle();
  7.  
  8. //Get the Write To Spreadsheet ID where the data will be written to
  9. var destinationSpreadsheet = form.getDestinationId();
  10.  
  11. //Activate that Spreadsheet by the destinationSpreadsheet ID
  12. var sheet = SpreadsheetApp.openById(destinationSpreadsheet).getActiveSheet();
  13.  
  14. //Find the last column and row
  15. var writeToColumn = sheet.getLastColumn()+1;
  16. var writeToRow = sheet.getLastRow();
  17.  
  18. //Write title to Spreadsheet next to submitted data.
  19. sheet.getRange(writeToRow, writeToColumn, 1, 1).setValue(formTitle);
  20.  
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement