I want to build a Calendar Add-ons for my Gsuit.

376 views
Skip to first unread message

Mohan Pd. Upadhyay

unread,
Mar 19, 2020, 8:00:30 AM3/19/20
to Google Apps Script Community
Hello everyone, 

I see some Add-ons on Gsuit Calendar. One of them is the Zoom cloud meeting app.

We have an urgent requirement inside our company, to build Calendar Add-ons.

I have searched around the web and did not find anything that could help me start.

My question is:

It is possible for now?

If possible, what is the best resources to get started.


Alan Wells

unread,
Mar 19, 2020, 9:17:51 AM3/19/20
to Google Apps Script Community
The documentation is at:

If the documentation doesn't answer your questions about what capability currently exists, please let us know exactly what you are trying to achieve.

Dimu Designs

unread,
Mar 19, 2020, 9:19:25 AM3/19/20
to Google Apps Script Community
GSuite Calendar add-ons are relatively new (less that a year since being released to the public), so you won't find much in terms of tutorials or guides. So you'll have to rely on the official documentation:

https://developers.google.com/gsuite/add-ons/calendar


On Thursday, March 19, 2020 at 8:00:30 AM UTC-4, Mohan Pd. Upadhyay wrote:

Nihal Shrestha

unread,
Mar 19, 2020, 9:54:01 AM3/19/20
to Google Apps Script Community
Thank you for the replay. This is what we are trying to implement. 
  1. 1. Create gsuite extension for google calendar.
  2. 2. Add one custom field in the extension.
  3. 3. Make sure google calendar calls our API endpoint when calendar event’s created.

Nihal Shrestha

unread,
Mar 19, 2020, 10:00:44 AM3/19/20
to Google Apps Script Community
Thank you for the replay. We have already looked into the developers guide and are still confused on how to start and test the add-on in the google calendar.

Alan Wells

unread,
Mar 19, 2020, 10:20:54 AM3/19/20
to Google Apps Script Community
To call an API from Apps Script, you will need to use:

UrlFetchApp.fetch(url,options)

From the code editor, click "Help" and then "Documentation"
Search for UrlFetchApp

You may need to go through a quickstart sample in order to get some basic understanding of how to set it up, and what it's capable of.

If you have some code, and a specific line of code is not getting a specific needed result, then it's easier to provide an answer.

I'm not sure what you mean by "adding a custom field."
Is this for user input in a user interface?
What is the field for?  A date?  A name?

Steve Webster

unread,
Mar 19, 2020, 10:21:26 AM3/19/20
to google-apps-sc...@googlegroups.com
@Nihal. I suggest you create a document or video screenshare that describes your questions. This community is not under a NDA. If that is a concern, you could reach out for paid help. For example, my company offers a 1-hour free consulting and provides a statement of work with estimates.

Kind Regards,

Steve Webster
SW gApps LLC, President 
Google Product Expert in: Google Apps Script, Drive, and Docs 
Google Vendor (2012-2013) || Google Apps Developer Blog Guest Blogger 
Add-ons: Text gBlaster 


--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/d4e1d451-4690-4dc4-af3f-af9c6d007aca%40googlegroups.com.

Nihal Shrestha

unread,
Mar 19, 2020, 10:46:59 AM3/19/20
to Google Apps Script Community
The field is just there to display the information like date, title, etc, which is triggered when an event is invoked.
And do you know any leads on how to test the add-on with calendar? I have tested add-on with spreadsheets but there is no any guide on how to test custom add-on with google calendars.

Nihal Shrestha

unread,
Mar 19, 2020, 10:49:11 AM3/19/20
to Google Apps Script Community
Thank you for the replay. I will definitely look into it.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-community+unsub...@googlegroups.com.

Alan Wells

unread,
Mar 19, 2020, 11:13:59 AM3/19/20
to Google Apps Script Community
A Calendar add-on has two triggers:

eventOpen - triggers when the user opens a calendar event
eventUpdate - triggers when the user edits and saves a calendar event

The Calendar add-on triggers are set up in the appsscript.json manifest file.

  "addOns": {
   
"calendar": {
     
"currentEventAccess": "READ",
     
"eventOpenTrigger": {
       
"runFunction": "onCalendarEventOpen"
     
},
     
"eventUpdateTrigger": {
       
"runFunction": "onCalendarEventUpdate"
     
},
     
"homepageTrigger": {
       
"runFunction": "onCalendarHomePageOpen",
       
"enabled": true
     
}
   
},


Quote:
If the user opens a Calendar event and then clicks the add-on icon, or the add-on is open when the user opens an event, the add-on executes the corresponding eventOpenTrigger function (if present). This function builds the add-on's Calendar event interface and returns to Google Calendar for display.
End Quote:

So, you should be able to test the eventOpen event by just opening a calendar event.  Or you can run the code directly from the code editor.  Have you tried adding triggers to the manifest (appsscript.json) file, saving it?  As soon as you save the manifest file it should configure the add-on.

To test:

Step 3: Install the unpublished add-on

The add-on is ready to test. Install it for testing by doing the following:

  1. Select Publish > Deploy from manifest... to open the Deployments dialog.
  2. In the Latest Version (Head) row, click Install add-on to install the currently saved version of the add-on in development-mode. If you install the Latest Version (Head) of the add-on, any changes you make to the add-on code are applied immediately without you needing to reinstall it.
  3. Click Close.

Nihal Shrestha

unread,
Mar 19, 2020, 11:29:42 AM3/19/20
to Google Apps Script Community
Thank you for sharing your knowledge. I am starting to understand about it.
 But i am new to this field so i have a question, like in spreadsheet i can go to tools>script editor to just start coding and testing out different things. But in google calendar there is no such options. My concern is how  and where should i start writing and testing the add-on?

Alan Wells

unread,
Mar 19, 2020, 12:33:29 PM3/19/20
to Google Apps Script Community
What you are describing is a "bound" Apps Script project, the Apps Script project is directly associated with the spreadsheet when you go to tools>script editor.

But you can create a "stand alone" Apps Script project which is what you need to do.  You can open the code editor directly:

But, I'd go into your Google Drive, create a project folder with the name of your add-on, and then create a new Apps Script file with that folder open.  From Google Drive, click "New" then click "More" and create a new Apps Script file.

You should have a folder for Projects in your Drive, and then separate folders under that folder for each project.

Something else that you should know about is your Apps Script Dashboard.

From the code editor, you'll see a blue box with a white arrow in it in the upper left hand corner.  Right click that and choose, Open in new tab, and it will open your Apps Script Dashboard.

Nihal Shrestha

unread,
Mar 20, 2020, 12:25:09 AM3/20/20
to google-apps-sc...@googlegroups.com
Thank you for your support. I really appreciate the help regarding the subject matter. If anything come up i will ping you. 

Nihal Shrestha

unread,
Mar 21, 2020, 11:03:40 AM3/21/20
to Google Apps Script Community
I was able to make a simple add-on. The add-on displays the calendar events like guests, conferencing data. But I am not able to get the event title, description and schedule dates. Do you have any idea on this?

Alan Wells

unread,
Mar 21, 2020, 11:14:47 AM3/21/20
to Google Apps Script Community
You're getting an error?

Nihal Shrestha

unread,
Mar 22, 2020, 12:11:18 AM3/22/20
to Google Apps Script Community
Not an Error.
Simply, the event object provided from the default event trigger doesn't contain any data about the dates, title, descriptions.

Alan Wells

unread,
Mar 22, 2020, 10:01:12 AM3/22/20
to Google Apps Script Community
If the code is run from the code editor there was no event, and therefore no event object.

Nihal Shrestha

unread,
Mar 22, 2020, 12:13:09 PM3/22/20
to Google Apps Script Community
I created a new event in the calendar which triggers an eventOpen/Update function(this reflects in my addon). The function contains an event object as parameter by default which contains the data like conferencing details, guests. But there is no data about event title, description, schedule. So, i am looking for that data.

Alan Wells

unread,
Mar 22, 2020, 12:34:17 PM3/22/20
to Google Apps Script Community
If you don't set the manifest file to:

"currentEventAccess":"READ"

then no event metadata is passed to the add-on.

Nihal Shrestha

unread,
Mar 22, 2020, 11:24:30 PM3/22/20
to Google Apps Script Community
I have already done it previously. But no any success.

Alan Wells

unread,
Mar 23, 2020, 10:05:06 AM3/23/20
to Google Apps Script Community
Sorry, I'm not sure what the problem is.

Nihal Shrestha

unread,
Mar 26, 2020, 5:15:06 AM3/26/20
to Google Apps Script Community
So, the meta data about the event details are not available from event object. I had to use Calendar Service for fetching the event data.

And, Is there a way we can directly add a custom field in default card view in google calendar. Not the one in add-on but like directly inside the default card provided by the google when an event is opened? Can it be done?
Reply all
Reply to author
Forward
0 new messages