title: Auto submit google form
body: <p>I have a google form which i don't have edit permission (i can only fill this form and submit it). And i want to submit this form on specified time automatically. It possible? If yes, how can i do this.</p>
  
  <p>I have to try createResponse to google form but it work only on form which i have edit permission.</p>
  
  <pre><code>function autoSubmitForm() {
    var ss = SpreadsheetApp.getActive();
    var sheet = ss.getSheetByName("Sheet1");
  
    var formUrl = "form URL";             // URL of the form
    var form = FormApp.openByUrl(formUrl);
    var items = form.getItems();
  
    var formResponse = form.createResponse();
  
    var page1 = items[0];
    var rp_page1 = page1.asMultipleChoiceItem().createResponse("Page 2");
    formResponse.withItemResponse(rp_page1);
  
    var page2_1 = items[2];
    var rp_page2_1 = page2_1.asMultipleChoiceItem().createResponse("Option 1");
    formResponse.withItemResponse(rp_page2_1);
  
    var page2_2 = items[3];
    var rp_page2_2 = page2_2.asMultipleChoiceItem().createResponse("Option 2");
    formResponse.withItemResponse(rp_page2_2);
  
    var page2_3 = items[4];
    var options = ["Option 1", "Option 2", "Option 4"];
    var rp_page2_3 = page2_3.asCheckboxItem().createResponse(options);
    formResponse.withItemResponse(rp_page2_3);
  
    var submit = formResponse.submit();
    Logger.log(submit);
    Logger.log(submit.getId());
    Logger.log(submit.getTimestamp());
  
    var lastRow = sheet.getLastRow() + 1;
    sheet.getRange(lastRow, 1).setValue(submit.getId());
    sheet.getRange(lastRow, 2).setValue(submit.getTimestamp());
  };
  </code></pre>