Calendly Replacement - Display Google Calendar internally

Most people know about Calendly (a calendar based - appointment booking app). I wish to recreate that to some extent within ERPNext.
We already have appointment booking within ERPNext, however I wish to:

  1. Separate appointment booking per agent (each agent has independent appointment booking)
  2. Integrate availability slots with google calendar.

Let’s say we have an agent called Agent A, I wish that Agent A had his own appointment booking settings, and when any client visits the front-end appointment booking page, they would see free time availability slots based on Agent A’s google calendar. If Agent A has an event on the 3rd of November from 8AM-11AM that time should naturally not show up as an availability slot. We already have google calendar integration so why not build on it. I cannot figure out how to display an integrated google calendar as a whole within ERPNext so I thought of a basic infrastructure:

  1. Have a new doctype for each Independent Google calendar (Let’s call this Google Calendar Booking). This doctype will contain a child table which will have all events within a google calendar as rows with basic description, start time and end time fields. Instead of pulling free time into the child table, we can simply pull booked times and have those as unavailable in appointments.
  2. The Child table discussed above will serve as the deciding factor for availability slots per Agent’s appointment booking settings. (This is not a difficult process, would require a simple child table pull script)

The difficulty i’m facing right now is with Step 1, I cannot figure out how to pull booked events from google calendar (this is probably the most crucial step to making all of this work :rofl:)

If anyone has any ideas/pointers or would like to help, please do not hesitate. I believe this would greatly benefit the community by improving upon ERPNext’s Appointment booking workflow

Have you considered using the already existing Google Calendars integration?

https://frappeframework.com/docs/user/en/guides/integration/google_calendar

You could create similar functionality yourself, of course, but you’d have to read up on the Google api structure, which is a bit complicated.

I intend to build upon the already present google calendar integration and you’re right I’d need to read up on Google’s api structure which is quite complicated but I dont intend to mess with that. My hierarchy is a bit simpler:

  1. Import the current month’s events from the google calendar into a child table. (Can’t figure this out, been trying since a week now ;-; )
  2. Use said child table events to map out free and busy times, use that for booking settings and so on and so forth.
1 Like

If you have the google calendar integration set up properly, you don’t have to pull anything. The events should just be created automatically. From there, I’m not sure why you would want to create another doctype duplicating the event data in a child table, but if you did it’d just be a matter of calling frappe.get_all("Event") and processing the data.

1 Like

So that would mean that any and all events in the calendar will be imported to ERPNext automatically? I do have my calendar integrated properly and any events I create within ERPNext show up in the calendar but events from the calendar are not imported/pulled into ERPNext. The rest is not hard to work with and the child table is not really a necessity, its just a workflow I thought of. My main problem is importing/pulling events from the calendar into ERPNext.

I’ve never used the google calendar integration myself, so there’s a limit to how specific I can be. It certainly looks like it’s designed to both push and pull events, however, so I would think both are possible.

Indeed, the current google calendar has a pull checkbox, however I’m unaware as to what it pulls and where it goes.

I’d assume it pulls to Event docs in the Calendar page. Is it not working?

Yeap that’s exactly it. It’s pulling nothing ;-; Although it is pushing events to the google calendar (which shows that google settings and the google calendar have been configured correctly). Could this be a bug within ERPNext?

It could be. It could also be an issue with how your Google api permissions are set up. You’ll have to dig in to see.