VOOZH about

URL: https://www.geeksforgeeks.org/techtips/how-to-build-g-suite-add-ons-with-google-apps-script/

⇱ How to Build G Suite Add-ons with Google Apps script? - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

How to Build G Suite Add-ons with Google Apps script?

Last Updated : 30 Mar, 2023

G Suite is a Google service that provides access to a core set of applications like Gmail, Calendar, Drive, Docs, Sheets, Slides, Forms, Meet, etc. Add-ons means the extension given to the pre-existing G Suite products (mentioned above). Developers can add many extra features to such products. Add-ons always run inside the G Suite products. We can create sidebars, dialogs, modals and add functionality to them in a seamless manner. Usually, we use the add-ons from G Suite Marketplace.

Examples of Add-ons:

πŸ‘ Image
πŸ‘ Image

 Coding your own Add-on:

Here we'll create an Add-On to send an E-mail from Google Docs (G Suite product). Follow the below steps to create an Add-On:

 Step 1: Go to docs.google.com > Create a blank Document > Tools > This brings up the (<> Script editor) as shown below:

πŸ‘ Image

Make sure that you are logged in with any of your Google account. Henceforth, you can proceed with Apps Script.

Here, The .gs file extension is associated with the Google Apps Script, a scripting language based on JavaScript for the G Suite products.

On hitting the plus button a dropdown menu will appear containing two options (HTML and Script). 

πŸ‘ Image

These HTML and Script files are used to add our custom designs.

 Step 2:   This is the Apps script code to be added to the .gs file.

Step 3:  Run the code as shown below. You will receive an email with a "Hello Geeks for Geeks!" message after the successful execution of your code. And we are done with our first Apps Script. Now to publish this as an Add-on to the G Suite Marketplace you need to deploy the changes after setting up your project on workspace.google.com 

 Step 4: Follow the steps to deploy your Add-on. Click on the Deploy button > New deployment > Select type (Add-on).

πŸ‘ Image
πŸ‘ Image

You will receive a project number from your google workspace. Using it finally you can publish your add-on to Marketplace.

Comment