Google Calendar integration with custom calendar object?

edited June 17, 2018 in Questions
We are a school with multiple teachers. The teachers are not assigned specific salesforce licenses. We have created a custom object for calendaring the teachers classes and wonder if we can show these custom calendars on google, teacher by teacher. Our teachers do have their own google accounts. 


  • Bill McCulloughBill McCullough 💎💎
    edited June 14, 2018

    I think that what you want to do is possible, but I am not sure that the 'experience' is what you want.  Since your connection to Google Calendar is only 'through' Skuid, you would have to open each teacher's calendar and 'push' the classes to the Google Calendar for each teacher.  This could be done declaratively on a class by class basis or using a snippet to copy all classes to their Google Calendar.  You would also need to have a way to 'link' or 'find' these 'added' calendar items to be able to update them when they change or remove and re-add them.

    I think the better answer is to create a trigger that syncs the class 'events' from Salesforce to the teacher's Google Calendar.  You might also be also be able to do something using one of the lightweight integration platforms like If This Then That or Zapier.


  • edited June 16, 2018
    Is the "event" that you are referring to the event under the salesforce activities object, or could it be a custom event object? Also, will these instructions work? or is this only for the native Salesforce event/activities object?

  • Bill McCulloughBill McCullough 💎💎
    edited June 15, 2018

    What I was suggesting could be done with any object in Salesforce.  You would view your Salesforce object and then have a feature that would 'push' those to Google Calendar.  You would be copying the items from your custom object into Google Calendar items.  When you want to 'refresh' you could delete the Google Calendar items and then re-add them from your custom object.  This would all be user initiated from your Skuid page.


  • edited June 15, 2018
    Thanks Bill. Do you have an example of a snippet that we could use to push the data? We used to have Zapier, but now don't. I could look into that. 
  • edited June 16, 2018
    Is there something here that we could use?

  • edited June 16, 2018
    I did these steps: 
    1. Set up google as a data source in skuid:
    2. Created a skuid page with a calendar component and two models--one for the google calendar and one for the events like it says here:
    3. Then I created tables on the skuid page with our custom event objects and created a mass edit code to select the rows and create google calendar events for them for one teacher's classes:
    params = arguments[0],
    $ = skuid.$,
        action = arguments[0].action,
        list = arguments[0].list;
        model = arguments[0].model,
        selectedItems = list.getSelectedItems();

    var AnnaCalModelId=skuid.model.getModel("MMA_Program_Session_Group_Anna").data[0].Id;
    console.log(AnnaCalModelId + " AnnaCalModelId ");

    if(AnnaCalModelId) {
        var GoogleModel=skuid.model.getModel("Anna_GCalendar_Events");
        $.each( selectedItems,
            function( i, item )
                var row = item.row;
                //get the START date/time from the MMA_Program_Session_Group_Anna
                var start_date_and_time=row.Start_Date_and_Time__c;
                console.log(' start_date_and_time ' + start_date_and_time);
                //var sf_start_date_time=row.start_date_and_time;
                var sf_start_date_time=row.Start_Date_and_Time__c;
                //get the END class date and time from the MMA_Program_Session_Group_Anna
            var end_date_and_time=row.End_Date_and_Time__c;
            console.log(' end_date_and_time ' + end_date_and_time);
            //var sf_end_date_time=row.End_Date_and_Time__c;
                var sf_end_date_time=row.End_Date_and_Time__c;
                //get javascript version Start Date/Time 
                var js_start_date_time=skuid.time.parseSFDateTime(start_date_and_time);
                //get javascript version End Date/Time
                var js_end_date_time=skuid.time.parseSFDateTime(end_date_and_time);  
                var newRow=GoogleModel.createRow({
                    additionalConditions: [
                        {field:'summary', value:row.MMA_Program__r.Name},
                        {field:'startDateTime', value:js_start_date_time},
                        {field:'endDateTime', value:js_end_date_time}
                        ], doAppend: true
  {callback: function(result){
            if (result.totalsuccess) {
                alert('Event was created in google');
            } else {
        alert('Select a row in the table to create a google calendar event for.');
     4. Now I need to figure out how to sync the google events with our custom salesforce event objects so that changes may be tracked. How do I do this when there is no actual model for the google calendar or its events outside of skuid? Here are some ideas:
    • add to a field to our internal events that will hold the google event id for each corresponding event entry in google. When the code is used to create the google events from our events, have it fill in the google id on our skuid event. Use that correlation to create a sync somehow. Maybe a change on the skuid event creates an alert -- "this event needs to be changed in google" -- and then we create some system to find the event and update it?
    • Is there a way to create a salesforce object from these skuid google calendar models so that we can use workflow and process builder on it when there are changes?
    Thanks for the help!
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!