DriveApp.getFolderById Errors

4,513 views
Skip to first unread message

Raymond Wood

unread,
Sep 18, 2021, 1:31:23 PM9/18/21
to Google Apps Script Community
Hello all. I keep seeing the following errors:

Exception: Unexpected error while getting the method or property getFolderById on object DriveApp. at saveImage(saveImage:7:28)

or 

Exception: Access denied: DriveApp. at saveImage(saveImage:7:23)

Folder ID is correct.


Code in my deployment

Capture1.PNG

Index.html to get a signature
Capture2.PNG
saveImage() to write the signature to a file. This is where I have the problem. Line 7: getFolderById
Capture3.PNG


cbmserv...@gmail.com

unread,
Sep 18, 2021, 2:15:59 PM9/18/21
to google-apps-sc...@googlegroups.com

Hi Raymond,

 

File ids do not contain “=” equal signs or “?” question marks. Strip the end of the Id that you have and try again. Everything from the ? to the end you should removed.

 

 

From: google-apps-sc...@googlegroups.com <google-apps-sc...@googlegroups.com> On Behalf Of Raymond Wood
Sent: September 18, 2021 8:25 AM
To: Google Apps Script Community <google-apps-sc...@googlegroups.com>
Subject: [Apps-Script] DriveApp.getFolderById Errors

 

Hello all. I keep seeing the following errors:

 

Exception: Unexpected error while getting the method or property getFolderById on object DriveApp. at saveImage(saveImage:7:28)

 

or 

 

Exception: Access denied: DriveApp. at saveImage(saveImage:7:23)

 

Folder ID is correct.

 

 

Code in my deployment

 

 

Index.html to get a signature

saveImage() to write the signature to a file. This is where I have the problem. Line 7: getFolderById

 

 

--
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/d655b085-2851-40ce-a4a3-b5668b73b8dcn%40googlegroups.com.

image001.png
image002.png
image003.png

Raymond Wood

unread,
Sep 18, 2021, 4:29:20 PM9/18/21
to google-apps-sc...@googlegroups.com

Thank you cbmserv...@gmail.com. Now I know to remove that portion of the URL.


Unfortunately that did not fix the problem. I am still getting access denied.

You received this message because you are subscribed to a topic in the Google Groups "Google Apps Script Community" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-script-community/-ipX5zsT3Jw/unsubscribe.
To unsubscribe from this group and all its topics, 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/002301d7acb9%243950e8d0%24abf2ba70%24%40gmail.com.

Raymond Wood

unread,
Sep 18, 2021, 4:42:53 PM9/18/21
to google-apps-sc...@googlegroups.com
Correction, it did. Thanks.

cbmserv...@gmail.com

unread,
Sep 18, 2021, 5:07:55 PM9/18/21
to google-apps-sc...@googlegroups.com
image001.png
image002.png
image003.png
Reply all
Reply to author
Forward
0 new messages