Submitting a form through google scripts

Viewed 4479

I need to submit a form in a google script but get this error:

TypeError: Cannot call method "withItemResponse" of undefined

According to the link below, this is how it should be set up https://developers.google.com/apps-script/reference/forms/form#createResponse()

Code:

 //Submit form

  var formID = row[24]; 

  var form = FormApp.openById(formID);
  Logger.log(form.getId());  //returns correct ID
  form.createResponse() ;
  form.FormResponse.withItemResponse('Core Teachers', logSummary);  
  //form has only two questions, a short text and a paragraph text
    form.FormResponse.submit(); 
1 Answers
Related