Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Apps Script personal script won't authorize [duplicate]

I am trying to run this simple Google Script.

However, it does not allow me to authorise. How can I proceed?

animation showing the sign-in disabled error

like image 686
orschiro Avatar asked Nov 27 '19 12:11

orschiro


People also ask

Why is my Google script not working?

There are a few possible causes for these errors: A Google server or system is temporarily unavailable. Wait for a few moments and try running the script again. There is an error in your script that doesn't have a corresponding error message.

How do you grant permission to an app script?

You can grant the Apps Script API access to your script projects using the Apps Script dashboard. You can also use the dashboard to revoke this access at any time. When you grant the API access, you are doing so for all applications. Individual applications still need to be authorized, however.

What is SS in Google script?

var ss = SpreadsheetApp. This line retrieves the current spreadsheet that's active. Since you're only running this script when the spreadsheet you want to run the calculation on is active, it'll always get the correct spreadsheet. The sheet gets saved as an “object” variable called “ss”.


2 Answers

Update 1:

  • As reported by Rubén, Google says it won't fix this - #163
  • Some workarounds are provided in #76, #145 and #150 - showing solutions like changing GCP and providing a oauth consent screen.

Update:

Switching Google cloud project from default to a standard project have resolved the issue for some users. This is still a workaround and may not work for all. Therefore, star the issue below.


This seems to be a new issue affecting certain users. You can ★(on top left) star the issue here to let Google developers know that you're affected by this issue and to prioritize the issue.

like image 80
TheMaster Avatar answered Oct 18 '22 09:10

TheMaster


It stopped complaining once I specified the script only needed access to the current sheet. Google explains how to do it here.

All you need to add to your code is this JsDoc annotation:

/**
 * @OnlyCurrentDoc
 */
like image 24
Emma Avatar answered Oct 18 '22 08:10

Emma