title: Can not get access form from Script Editor - create edit form link
body: <p>I'm using google apps script to create a link to a submitted form and add this link to the spreadsheet so people can amend the submitted form at a later stage using the link.</p>
  <p>The script is as follows:</p>
  <pre><code>// Form URL
    var sheetName = 'Complete Overview';
    var columnIndex = 8;
  
  function getEditResponseUrls() {
      var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Complete Overview');
      var data = sheet.getDataRange().getValues();
      var form = FormApp.openByUrl('https://docs.google.com/forms/d/e/FORMID/viewform');
       var finalUrl = null;
      for (var i = 2; i &lt; data.length; i++) {
          if (data[i][0] != '' &amp;&amp; data[i][columnIndex - 1] == '') {
              var timestamp = data[i][0];
              var formSubmitted = form.getResponses(timestamp);
              if (formSubmitted.length &lt; 1) {
                  continue
              } else {
                  var editResponseUrl = formSubmitted[0].getEditResponseUrl();
                  sheet.getRange(i + 1, columnIndex).setValue(editResponseUrl);
                  finalUrl = editResponseUrl;
                  break;
              }
          }
      }
      return finalUrl
  }
  
  var editResponseUrlLink = getEditResponseUrls()
  </code></pre>
  <p>When I submit a form I get the error message &quot;Exception: No item with the given ID could be found. Possibly because you have not edited this item or you do not have permission to access it.&quot;</p>
  <p>I do have access to the form (it's on a shared drive, I tried to move it to my personal drive but this did not work), gave permission to Google to access the necessary documents and the URL is correct (this seemed to be the problem for other users).</p>
  <p>Any ideas?</p>