# How to Insert Event in Google Calendar

**URL:** <https://community.thunkable.com/t/how-to-insert-event-in-google-calendar/1019722>\
**Category:** Web API's\
**Created:** [December 4, 2020, 7:29am UTC](https://community.thunkable.com/t/how-to-insert-event-in-google-calendar/1019722 "2020-12-04T07:29:34Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![tchind](https://avatars.discourse-cdn.com/v4/letter/t/ebca7d/32.png) [@tchind](https://community.thunkable.com/u/tchind)\
**Post date:** [December 4, 2020, 7:29am UTC](https://community.thunkable.com/t/how-to-insert-event-in-google-calendar/1019722/1 "2020-12-04T07:29:34Z")

</div>

How to Insert Event in G Calendar ?

It is quite complicated according to their docs  
Do you have any blocks code?  
Has Anyone Every tried this?  
@darren @jared @jane @cttricks ?  
Any Ideas  
@thunkableexperts?  
@AnyoneWhocouldhelp

And Please do not give WEB Api Docs.

Your Regards,  
TchInd Technologies’  
(Formerly Called Techindia Is Here)

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [December 4, 2020, 8:03am UTC](https://community.thunkable.com/t/how-to-insert-event-in-google-calendar/1019722/2 "2020-12-04T08:03:35Z")

</div>

I know you don’t want the API Documentation link but I’m posting this for other people who might read your question:

> **[Events: insert  |  Calendar API  |  Google Developers](https://developers.google.com/calendar/v3/reference/events/insert)**

It’s going to require a POST call to the API. I’ve been trying to figure out how to do those from within Thunkable but haven’t succeeded. I can get them (not Google Calendar but other API POST calls) to work with the Postman application or a _curl_ command in Terminal on a Mac.

---

<div class="post-metadata">

**Author:** ![cttricks](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/cttricks/32/93678_2.png) [@cttricks](https://community.thunkable.com/u/cttricks)\
**Post date:** [December 7, 2020, 8:43am UTC](https://community.thunkable.com/t/how-to-insert-event-in-google-calendar/1019722/3 "2020-12-07T08:43:14Z")

</div>

You can use **Google Apps Script** to created a webhook to create event in G Calendar.  
Get Server/Webhook Codes from [Github](https://github.com/cttricks/Google-Calendar-WH/).

> Note : You can do more with G-Calendar by using this webhook ([View Docs](https://developers.google.com/apps-script/reference/calendar)).

**Blocks Screen Shot**

 ![blocks](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/4/a448bb7f82a5a603e9ad29a16b8e30aef48498e9.png)

[Click here](https://x.thunkable.com/copy/5358b9a3c878a16df3b13eaa211a13d5) to view sample Calendar project made on x.thunkalbe  
Ct tricks

---

<div class="post-metadata">

**Author:** ![overshield](https://avatars.discourse-cdn.com/v4/letter/o/e19b73/32.png) [@overshield](https://community.thunkable.com/u/overshield)\
**Post date:** [March 20, 2022, 8:01pm UTC](https://community.thunkable.com/t/how-to-insert-event-in-google-calendar/1019722/6 "2022-03-20T20:01:55Z")

</div>

Did you skip some steps in your post here? I’ve tried this and several different variations with no success.

Thanks

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [March 20, 2022, 8:31pm UTC](https://community.thunkable.com/t/how-to-insert-event-in-google-calendar/1019722/7 "2022-03-20T20:31:28Z")

</div>

In Whose calendar do you want events inserted? Yours or your users?

It’s a lot easier to add it to yours than others calendars.

But, setup oauth and sky’s the limit.

[https://x.thunkable.com/projectPage/61e4e200e0ca1b001138c8b3](https://x.thunkable.com/projectPage/61e4e200e0ca1b001138c8b3)

Here’s one way of doing it ^^^^

This example only GETs cal events but does so as an authenticated user. Get this far and I can show you how to create events for any user who gives your app permission!

---

<div class="post-metadata">

**Author:** ![tchind](https://avatars.discourse-cdn.com/v4/letter/t/ebca7d/32.png) [@tchind](https://community.thunkable.com/u/tchind)\
**Post date:** [March 21, 2022, 4:53am UTC](https://community.thunkable.com/t/how-to-insert-event-in-google-calendar/1019722/8 "2022-03-21T04:53:40Z")

</div>

I have also never had success with google app script , @overshield . But here is another approach - [How to set Reminder Notifications with Zapier in Thunkable X? - YouTube](https://community.thunkable.com/t/how-to-set-reminder-notifications-with-zapier-in-thunkable-x-youtube/1258683)

---

<div class="post-metadata">

**Author:** ![overshield](https://avatars.discourse-cdn.com/v4/letter/o/e19b73/32.png) [@overshield](https://community.thunkable.com/u/overshield)\
**Post date:** [March 21, 2022, 5:45am UTC](https://community.thunkable.com/t/how-to-insert-event-in-google-calendar/1019722/9 "2022-03-21T05:45:55Z")

</div>

I’m wanting users to be able to add or remove to my calendar only.

I suppose it might be an added benefit to allow users to update their calendar also, but that’s assuming they use google calendar.

But again primarily just needs to be my calendar to add appointments, if they cancel their appointments in app it should delete the event too.

Currently my users can cancel appointments so I just need to add the delete event it seems.

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [March 21, 2022, 10:32am UTC](https://community.thunkable.com/t/how-to-insert-event-in-google-calendar/1019722/10 "2022-03-21T10:32:30Z")

</div>

There’s also share links that google provides. A link that when clicked allows users to add events to their calendar. Might work for you. Gonna try to dig that up today!

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [March 21, 2022, 10:54am UTC](https://community.thunkable.com/t/how-to-insert-event-in-google-calendar/1019722/11 "2022-03-21T10:54:45Z")

</div>

> [@jared](#):
>
> Gonna try to dig that up today!

See this

> [@Reminder after period](https://community.thunkable.com/t/reminder-after-period/184189/7):
>
> Specially that there are many ways to trigger an event in the calender. This URL for example will open the calendar and fill in the info [Create Event in Google calendar](https://calendar.google.com/calendar/u/0/r/eventedit?text=Thunkable+Event&details=Example+of+some+description.&location=123+Some+Place,+City&dates=20210504T1000/20210504T1130) Of course, in the app you will use variables instead of the text I typed in the URL. No need to use any other tool outside of Thunkable.

---

<div class="post-metadata">

**Author:** ![overshield](https://avatars.discourse-cdn.com/v4/letter/o/e19b73/32.png) [@overshield](https://community.thunkable.com/u/overshield)\
**Post date:** [March 21, 2022, 2:54pm UTC](https://community.thunkable.com/t/how-to-insert-event-in-google-calendar/1019722/12 "2022-03-21T14:54:48Z")

</div>

I saw this one, but it does allow the user to edit the calendar which could cause problems, is there a way to use this link and execute it or does it require that final step to confirm?

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [March 21, 2022, 6:26pm UTC](https://community.thunkable.com/t/how-to-insert-event-in-google-calendar/1019722/13 "2022-03-21T18:26:19Z")

</div>

Use Google Apps Script

Example

```auto
function addEvents() {
   return CalendarApp.getDefaultCalendar().createEventFromDescription('test event, today 9AM');
 }

```

If you add this to your script and call this function, it will add an event to your calendar.

---

<div class="post-metadata">

**Author:** ![overshield](https://avatars.discourse-cdn.com/v4/letter/o/e19b73/32.png) [@overshield](https://community.thunkable.com/u/overshield)\
**Post date:** [March 21, 2022, 6:56pm UTC](https://community.thunkable.com/t/how-to-insert-event-in-google-calendar/1019722/15 "2022-03-21T18:56:10Z")

</div>

Ok I got this to work via my google script screen and it did in fact create the event in my calendar, the first time I ran it, it failed, then I clicked run again and it sent me to the auth page to allow it. It also said it hasn’t been verified by google but I proceeded anyway, once I did all of that it created the event.

How do I call this function from the app?  
Here’s what I’ve got so far…

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/3/63f4722fd1c4313affe3a43bc5b034cc203ab331.png)

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/2/b/2bf269973027511c06eac7b58e2ce898bcc6bd91.png)

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [March 21, 2022, 7:07pm UTC](https://community.thunkable.com/t/how-to-insert-event-in-google-calendar/1019722/16 "2022-03-21T19:07:44Z")

</div>

To run it from Thunkable you need to first Deploy it to the Web. However, to pass any parameters to it you need to wrap it in `doGet` function.

> [@overshield](#):
>
> the first time I ran it, it failed, then I clicked run again and it sent me to the auth page to allow it. It also said it hasn’t been verified by google but I proceeded anyway, once I did all of that it created the event.

This is typical with every GAS (Google Apps Script) function.

---

<div class="post-metadata">

**Author:** ![overshield](https://avatars.discourse-cdn.com/v4/letter/o/e19b73/32.png) [@overshield](https://community.thunkable.com/u/overshield)\
**Post date:** [March 21, 2022, 7:11pm UTC](https://community.thunkable.com/t/how-to-insert-event-in-google-calendar/1019722/17 "2022-03-21T19:11:07Z")

</div>

I went ahead and deployed it and got the macro/s/\*\*\*/exec URL

I’m not sure how to wrap that into a doGet function though

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [March 21, 2022, 7:24pm UTC](https://community.thunkable.com/t/how-to-insert-event-in-google-calendar/1019722/18 "2022-03-21T19:24:55Z")

</div>

See this tutorial. It is for saving Canvas image to GDrive but will give you insight of how to use **doGet/doPost** to pass parameters from Thunkable to GAS.

> [@Save Canvas Image to your Google drive](https://community.thunkable.com/t/save-canvas-image-to-your-google-drive/1609950):
>
> For this tutorial you will need to code a short script in Google Apps Script which you can access it from within Google Drive. You will need to use Web API component to talk to the script you created in Google Apps Script and pass the parameters using the Query Parameter section the the Body section. The Base64 image cannot fit into the Query Parameter section and therefore will will need to pass it using the Body section of the Web API. The Thunkable project is very simple and is used to demo…

---

<div class="post-metadata">

**Author:** ![overshield](https://avatars.discourse-cdn.com/v4/letter/o/e19b73/32.png) [@overshield](https://community.thunkable.com/u/overshield)\
**Post date:** [March 21, 2022, 7:42pm UTC](https://community.thunkable.com/t/how-to-insert-event-in-google-calendar/1019722/19 "2022-03-21T19:42:28Z")

</div>

Ok I have the following, works from inside the google web page, but I must have something wrong in the app. I’m getting a 401 status

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/d/0/d040e82b73a8b8ad3049150ab7783e57be0d839e.png)  
Is this correct with the doPost in the object component?  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/2/4/24cb80ed9052af4b6af4595cfbc1cf8dd5078c8c.png)

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [March 22, 2022, 6:47am UTC](https://community.thunkable.com/t/how-to-insert-event-in-google-calendar/1019722/20 "2022-03-22T06:47:21Z")

</div>

Your Thunkable blocks should only pass the text of the event.

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/d/0/d0031030ff957c6abaa6b2898cdfa855e51d1dc5.png)

Your function will then be something like this.

```auto
function doPost(event) {
   return CalendarApp.getDefaultCalendar().createEventFromDescription(event.parameters.eventDesc);
 }

```

---

<div class="post-metadata">

**Author:** ![overshield](https://avatars.discourse-cdn.com/v4/letter/o/e19b73/32.png) [@overshield](https://community.thunkable.com/u/overshield)\
**Post date:** [March 22, 2022, 10:45am UTC](https://community.thunkable.com/t/how-to-insert-event-in-google-calendar/1019722/21 "2022-03-22T10:45:51Z")

</div>

I thought you edit the date and time from that text box. But you are saying only the description?

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [March 22, 2022, 10:49am UTC](https://community.thunkable.com/t/how-to-insert-event-in-google-calendar/1019722/22 "2022-03-22T10:49:26Z")

</div>

> [@overshield](#):
>
> But you are saying only the description?

There are many functions in the calendar object. I’m using here the function `createEventFromDescription` so you need to pass description such as:  
**Thunkable advanced meeting 10AM**. The function will parse the description and create a meeting event from it.

You could see the list of functions and choose the one that fits your need.

---

<div class="post-metadata">

**Author:** ![overshield](https://avatars.discourse-cdn.com/v4/letter/o/e19b73/32.png) [@overshield](https://community.thunkable.com/u/overshield)\
**Post date:** [March 22, 2022, 11:00am UTC](https://community.thunkable.com/t/how-to-insert-event-in-google-calendar/1019722/23 "2022-03-22T11:00:31Z")

</div>

I now have the following but I’m not getting a calendar event

```auto
function doPost(event) {
   return CalendarApp.getDefaultCalendar().createEventFromDescription(event.parameters.eventDesc);
 }

```

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/5/95cca645fe6d8e5c3e4a6c0de06b35e3df1e6143.jpeg)

[Next page](https://community.thunkable.com/t/how-to-insert-event-in-google-calendar/1019722.md?page=2)
