Google Apps-Script Not Firing on Form Submission
<p>I have set up a Google form that has an app-script attached to it. When the form is completed, the App-script creates a new Case in SFDC based upon the information contained on the form. It has worked, but seems to now be breaking down. When I submit a form, no case is created in SFDC but also no errors come up in the script. However, when I run the script directly from the underlying Google Sheet of my form (Tools || Script Editor || Run || Script name), a case is created as expected. I know very little about App-Scripts so it's very difficult to debug. I have a feeling it has something to do with the 1st 2 or 3 lines of my code applying to the active sheet, but I am not sure. Can anyone suggest a fix for this?</p>

<pre><code>function SendtoSalesforce() {
  var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
  var row = sheet.getLastRow();
  var AcctID = sheet.getRange(row, 6).getValue();
  var WidgetID = sheet.getRange(row, 7).getValue();
  var Platform = sheet.getRange(row, 8).getValue();
  var PageType = sheet.getRange(row, 9).getValue();
  var LinkScreen = sheet.getRange(row, 11).getValue();
  var ViolationType = sheet.getRange(row, 13).getValue();
  var resp = UrlFetchApp
      .fetch(
          'https://www.salesforce.com/servlet/servlet.WebToCase?encoding=UTF-8',
          {
            method: 'POST',
            payload: {
              'orgid' : '00DD0000000DQCv',
              'recordType' : '012570000003Hnf',
              '00N57000006MCz7' : 'Test',
              '00N57000006MCyz' : AcctID,
              '00N57000006MCzG' : WidgetID,
              '00N57000006MCzB' : Platform,
              '00N57000006MCzA' : PageType,
              '00N57000006MCz9' : LinkScreen,
              '00N57000006MCzN' : ViolationType,
              'status' : 'New',
              'subject' : 'CV - ',
              'external' : '1'
            }
          });
  Logger.log(resp.getContentText());
}
</code></pre>