Error: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.

3,123 views
Skip to first unread message

Javier Chames

unread,
Oct 18, 2022, 7:58:50 AM10/18/22
to Google Apps Script Community
Hello
This is my scenario
I created a form(4 questions) and linked a google sheet-that was created also by the form..
inside the google sheet i opened the script and i try to do that:
  var googleForm = FormApp.openByUrl(formUrl)
i provided the formurl variable...
but i get this error
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.

I checked everything-also the app script json

any idea what i miss?....
Thanks


cbmserv...@gmail.com

unread,
Oct 18, 2022, 4:42:50 PM10/18/22
to google-apps-sc...@googlegroups.com

It looks like you provided the wrong url perhaps. I usually prefer using only the ID of the form as that is more straightforward.

 

Use   var googleForm = FormApp.openById(formId);

 

Id can be found in the URL when you edit a form as follows:

 

https://docs.google.com/forms/d/1GSSUA6BXsUXtNES31FFF1lHZU-KvVNPdS5ky7J7fVuA/edit

 

in the example above, the Form Id starts with 1GG and ends before the /edit.

 

so in your code, define it as follows:

var formId = “1GSSUA6BXsUXtNES31FFF1lHZU-KvVNPdS5ky7J7fVuA”;

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/174e043b-f97b-4bc7-92ef-bcfb6db15bd7n%40googlegroups.com.

Jonathan Butler

unread,
Oct 18, 2022, 5:31:49 PM10/18/22
to google-apps-sc...@googlegroups.com
I would double-check that you aren't on multiple accounts (one owning the form, and the other accessing the script) and that you are pasting the correct link into the script.

Reply all
Reply to author
Forward
0 new messages