FormApp.openById Error: "No item with the given ID" Despite Correct Setup

165 views
Skip to first unread message

Queen

unread,
Nov 5, 2024, 2:02:52 PM11/5/24
to Google Apps Script Community

Hi everyone,

I’m working on a project but I’m hitting a strange issue with FormApp.openById in Google Apps Script. Even though I own both the form and the script under the same personal Google account, I keep getting this error:

"Direct form access error: 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. "

Here’s What I Tried

I set up a simple test function to isolate the problem:

function testFormAccessById() {

  try {

    const formId = "YOUR_FORM_ID";  // Replace with the actual form ID

    const form = FormApp.openById(formId);

    form.setAcceptingResponses(false);  // Attempt to close the form

    Logger.log("Form access and closure successful.");

  } catch (error) {

    Logger.log("Direct form access error: " + error.message);

  }

}

But the error persists! I tried with different sheets and form. Same ! 

 Here’s what I can  confirm so far:

  • The form and script are in the same account, which is a personal Google account.
  • All the required OAuth scopes are in place, including https://www.googleapis.com/auth/forms.
  • The form ID and link are correct and accessible in the browser.

Similar Issues in the Community

From what I’ve seen in recent posts, other users are experiencing similar problems with script execution times and errors since around September 2024. There’s an open ticket that might be related: https://issuetracker.google.com/issues/377475531.

Any Ideas?

If anyone else is running into this or has ideas for a workaround, I’d appreciate any tips.

Thanks in advance for any help!


Reply all
Reply to author
Forward
0 new messages