google-apps-script Getting started with google-apps-script Types of Scripts

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Example

Google App scripts are of three types.

  • Standalone
  • Bound to Google Apps
  • Web Apps

Standalone script

Standalone scripts are not bound to any Google apps i.e Docs, Sheets or Forms etc. Standalone script can either be created by visiting script.google.com or by connecting Google app script with Google drive. Standalone script can be used to program Google apps independently, can be used as a Web App or can be set up to run automatically from an installable trigger. See the documentation for standalone script.

Bound to Google Apps

Script bound to Google Apps also known as container-bound script; unlike standalone scripts, are bound to Google apps i.e Google Docs or Google Sheets etc. Container bound script can be created by selecting tools> Script editor from Google App. Some features like dialogs, prompts, menus and sidebar are only provided by container-bound scripts. Furthermore, container-bound script is used to create Google Add-ons. See the documentation for container-bound scripts.

Web Apps

Google App Script can be used as web app as they can be accessed by browser. Web App can provide user interface on the browser and can make use of google apps i.e docs, sheets etc. Both standalone scripts and scripts bound to Google Apps can be turned into web apps. For any script to work as a web app, script has to meet two requirements:

  • include a doGet() or doPost() function.
  • The function returns an HTML service HtmlOutput object or a Content service TextOutput object.

Inshort, doGet() and doPost() functions works like http get and post request handlers respectively.

For more details on Web Apps, see the official documentation.



Got any google-apps-script Question?