Take the 2-minute tour ×
Web Applications Stack Exchange is a question and answer site for power users of web applications. It's 100% free, no registration required.

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:

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

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)?

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

Found the solution here: http://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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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