I'm trying to write a Google Apps Script web app, which will, eventually, populate a spreadsheet. However, I'm having a hard time getting started.

I have an HTML file:

  <select name="player1"></select>
  <input type="number" name="score1"/>
  <select name="player2"></select>
  <input type="number" name="score2"/>

and a script file:

function doGet() {
  return HtmlService.createTemplateFromFile('myHtmlFile.html').evaluate();

I have published it as a web app (Publish -> Distribute as web app -> Update), and set the app to run as myself, with only myself allowed to access it.

After that, clicked the link to "test your newest code". However, this link gives me nothing but the message "Authorization is necessary to perform this action" (translated).

How can I perform this authorization, and why is it necessary (as I'm running the app as myself, with access only to myself)?


Found the solution here: https://stackoverflow.com/questions/11421055/how-do-i-stop-the-error-authorisation-is-required-to-perform-that-action-in-goo

It is also mentioned in the official documentation: https://developers.google.com/apps-script/troubleshooting#common_errors

In short:

  1. In the Script editor, run the doGet function from the dropdown menu

  2. An authorization popup shows

  3. Grant access

  4. Re-run the app from the "latest code" link, and you should not get the authorization error

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.