Google Spreadsheet Script Trigger: This app is blocked

7,458 views
Skip to first unread message

Boyan Sabev

unread,
Feb 23, 2021, 4:35:28 PM2/23/21
to Google Apps Script Community

I am trying to create a trigger for a script in google spreadsheet and upon trying to save the trigger I am getting the following error:


This app is blocked This app tried to access sensitive info in your Google Account. To keep your account safe, Google blocked this access.


I don't have G-Suite, I don't have an organization, I am simply using my personal Gmail account. I don't have the special account protection thing enabled. I tried using different scripts, even an empty script. What could be the problem here? I have used scripts and add-ons in the past, but haven't needed triggers yet. Is there another way to run a script daily or monthly, without this trigger functionality?



I get this when I go to tools > script editor, then I paste in my script (which is very simple, I even tried an empty script), then I go to triggers and when I try to save a trigger it asks me to authenticate and then this error. There aren't any other developers or even apps. What am I doing wrong?

Faustino Rodriguez

unread,
Feb 24, 2021, 11:59:14 AM2/24/21
to Google Apps Script Community
Just in case, 
- did you run the script first manually from the editor to provide authorization?

Gregory Kalabin

unread,
Feb 25, 2021, 6:00:38 PM2/25/21
to Google Apps Script Community
I have exactly the same issue: personal account, own both script and the spreadsheet and the script is just an empty function. I did run the function manually, but still access is denied

H Wei

unread,
Feb 28, 2021, 8:39:04 PM2/28/21
to Google Apps Script Community
You may need to use a Google Workspace account instead, or set up a Google Cloud project and specifically set a list of test users, or submit your Script and/or Web App for review and verification.  This is probably to ensure high security & privacy for access to personal documents via the Google Apps Scripts API e.g. Spreadsheet, Calendar, Docs.

For personal accounts (rather than Google Workspace accounts) it looks like Apps Script blocks access to Calendar API and other sensitive information APIs.

I was seeing the error message:
"This app is blocked"
"This app tried to access sensitive info in your Google Account. To keep your account safe, Google blocked this access."

1. You will probably need to set up a Google Cloud Platform (GCP) Project if you want to access Spreadsheet or Calendar scripts.
You can link the GCP Project ID in the Project Settings panel of your Apps Script project.
There, it says "Apps Script projects use Google Cloud Platform to manage authorizations, advanced services, and other details. To learn more, visit Google Cloud Platform."

2. There, you will need to set up APIs & Services, including OAuth consent screens.
There, two options will be displayed: 
Internal
or 
External.

But Internal is not available to personal GMail account users -- only Google Workspace users.
"Because you’re not a Google Workspace user, you can only make your app available to external (general audience) users."

And for external-facing apps, the app will only be available to a list of test users:
"Available to any test user with a Google Account. Your app will start in testing mode and will only be available to users you add to the list of test users. Once your app is ready to push to production, you may need to verify your app ."

(I'm new to Apps Script but encountering the same error messages without much explanation for them.)


Andrey Krivko

unread,
May 25, 2021, 6:47:30 AM5/25/21
to Google Apps Script Community
I have exactly the same issue. When I'm trying to add a trigger with the default params in a new apps script I get the "This app is blocked" error.
I am definitely sure this worked for me previously as I have an old appscript where I do have a trigger configured. But when I try to add a new trigger in that script the same "This app is blocked" error happens.

I guess it somehow related to my account. I tried to do the same steps in a different personal account and everything works fine there. One thing I noticed, in an account where everything works I have a different set of menu items compared to the account where the "This app is blocked" error happens.

Menu for an account with error:
Image 2021-05-25 16-40-17.png

Menu for an account without error:
Image 2021-05-25 16-41-22.png

Did anyone figure out how to solve this issue? Who I can contact to fix issues with my google account?

Thanks!

Zzzzzz

unread,
Jul 15, 2021, 6:22:31 PM7/15/21
to Google Apps Script Community
This solved my issue! Thanks!!!

Abhi S

unread,
Sep 19, 2021, 5:42:34 AM9/19/21
to Google Apps Script Community
https://support.google.com/accounts/answer/6010255?hl=en#zippy=%2Cif-less-secure-app-access-is-on-for-your-account

Disable 2-step Verification and it will work. All you have to do is enable " Less secure apps" and you will be able to access the script. 

I also used to get the issue "This app is blocked " issue a lot

Abhi S

unread,
Sep 19, 2021, 5:42:58 AM9/19/21
to Google Apps Script Community
https://support.google.com/accounts/answer/6010255?hl=en#zippy=%2Cif-less-secure-app-access-is-on-for-your-account

Disable 2-Step Verification then you can enable this feature  "Less secure apps " on your Google Settings
On Wednesday, 24 February, 2021 at 3:05:28 am UTC+5:30 Boyan Sabev wrote:

KGuiste1

unread,
Oct 29, 2021, 9:12:19 AM10/29/21
to Google Apps Script Community
what solved it for you? I'm still looking for a solution.

Jeffrey Kahn

unread,
Jul 1, 2022, 2:13:06 PM7/1/22
to Google Apps Script Community
Now that "less secure apps" is no longer an option, is there a way to use the htmlservice within a google sheet at all?

Jonathan Butler

unread,
Jul 1, 2022, 5:00:11 PM7/1/22
to google-apps-sc...@googlegroups.com
You can always create a web app and call it with whatever external app you are building. You can even have it pass a secret key for extra security. Since a web app runs with all of your permissions anyway you won't need to auth with your user name and password.

--
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/c862ffc6-347c-4fd0-9f83-0cf71fbcf075n%40googlegroups.com.

Sebastian Rothbucher

unread,
Jan 29, 2023, 2:09:13 PM1/29/23
to Google Apps Script Community
Linking the script to a project in GCP (seems like any project) did solve it for me.
Reply all
Reply to author
Forward
0 new messages