Google Apps Script

Web Apps

When you build a script with a user interface, either via Html Service or Ui Service , you can deploy the script as a web app so users can access it. For example, if you build a script that allows users to schedule appointments with members of a support team, you can deploy that script as a web app so your users can access it directly.

  1. Requirements for Web Apps
  2. Deploying Your Script as a Web App
  3. Permissions and Web Apps

Requirements for Web Apps

In order to deploy a script as a web app, it must contain the doGet(e) function. User interfaces for web apps can be built using either the Html Service or the Ui Service.

Before you can deploy a web app, you must save a version of your script. To do so, choose File > Manage Versions in the Script Editor, provide a description for the version, and then click Save New Version.

Deploying Your Script as a Web App

Once you have created your web app and saved a version, you can deploy it from the Script Editor. Choose Publish > Deploy as web app from the menu. A dialog will appear where you will need to make three decisions about how to publish your web app:

  1. Project version: Which saved version do you want to publish?
  2. Execute the app as: Do you want the web app to execute as you (the owner of the script) or as the active user who is accessing the web app?
  3. Who has access to the app: The options for this select box will differ depending on the type of account you have, but they can include only yourself, any member of your domain, anyone, or anyone including allowing anonymous access.

Once you've selected the options you want to use for your web app, click the Deploy button. You'll see a new dialog with a message indicating that your project has been successfully deployed as a web app. Below that message you'll find the URL of your web app. Copy that URL and use it to access your web app in a browser.

Permissions and Web Apps

The permissions for a web app differ depending on whether you chose to execute the app as you (the owner of the script) or as the active user who is accessing the web app.

If you chose for the script to execute as you, then the script will always execute under your identity, that is, the identity of the owner of the script. This will be the case regardless of which user is accessing the web app.

If you chose for the script to execute as the active user who is accessing the web app, then the script will execute under the identity of the active user who is accessing your script.

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.