Skip to main content
Build the future with Agentforce at TDX in San Francisco or on Salesforce+ on March 5–6. Register now.

Explore Calendar Integration Options

Learning Objectives

After completing this unit, you’ll be able to:

  • Enable the settings to show service appointments as events on the Salesforce calendar.
  • Describe how syncing the Salesforce calendar with an external calendar works.
  • Describe how to write Salesforce appointments to an external calendar using platform events.

Meet Calendar Integration

Matt O’ Brien, the Salesforce admin at Cumulus Cloud Bank.

Say hi to Matt O’ Brien, the trusty Salesforce admin at Cumulus Cloud Bank. It’s a sunny day in Pennsylvania, and Matt is barbecuing lunch with his daughter in their backyard. “It’s all about getting the timing right for that perfect steak,” he tells her. As he’s about to enjoy his meal, a financial advisor frantically calls to tell him that they missed an online appointment with their client. They lost track of time and their phone’s calendar didn’t save the meeting.

This is not the first time users have missed important opportunities at Cumulus. They have always wanted a solution to sync appointments to their external calendar apps. They also don’t want meetings, training sessions, and other events on their external calendar to have a scheduling conflict with Salesforce Scheduler appointments.

Matt explores the possibilities to overcome these challenges. He recognizes that there are several ways to show appointments on calendars and sync those calendars.

  • Show service appointments as events on the Salesforce calendar.
  • Sync the Salesforce calendar and an external calendar using calendar sync tools such as Einstein Activity Capture.
  • Write Salesforce Scheduler appointments to an external calendar using platform events and APIs. This method requires Salesforce programming expertise and is ideal if he wants to exercise greater control over the entire process.

Matt also learns that he can configure scheduling policy rules to check the Salesforce calendar and external calendar to determine availability.

In this module, follow Matt to learn about calendar integration and scheduling policy rules. With this knowledge, choose how to integrate calendars and configure scheduling policy rules for your business.

Show Service Appointments as Events

To write Salesforce Scheduler appointments as events on the Salesforce calendar, Matt must enable event management. But before he does that, he must consider the important points mentioned in Considerations to Write Appointments to Salesforce Calendar in Salesforce Help.

  1. From Setup, in the Quick Find box, enter Salesforce Scheduler, then select Salesforce Scheduler Settings.
  2. Enable Event Management.

With Event Management enabled, service resources can see their scheduled appointments as events on their Salesforce calendar. Any assets, such as rooms or equipment, that are booked in an appointment don’t create calendar events. When there are changes to service appointments, Salesforce Scheduler automatically updates the corresponding event on the Salesforce calendar.

To learn how fields on the Event object map to the fields on the Service Appointment and Assigned Resource objects, see Write Salesforce Scheduler Appointments to Salesforce Calendar in Salesforce Help.

Sync Salesforce Calendar with External Calendar

To sync the Salesforce calendar with an external calendar, Matt evaluates multiple tools. After carefully going through Einstein Activity Capture Considerations in Salesforce Help, he chooses and sets up Einstein Activity Capture. To learn how to set up Einstein Activity Capture for calendar integration, check out Salesforce, Gmail, and Google Calendar Integration in Trailhead.

When you set up Einstein Activity Capture, you must specify the sync direction. Here’s a table that shows the different sync directions, the expected behavior, and where users must edit events—which aren’t related to service appointments—based on the sync direction.

Sync Direction

Expected Behavior

Where to Edit Events

Salesforce calendar to external calendar

Events created and edited on the Salesforce calendar appear on and sync to the external calendar.

When you enable Event Management, Salesforce Scheduler writes appointments as events on the Salesforce calendar.

Then, Einstein Activity Capture syncs the events to the external calendar. For example, when a customer books an appointment using Salesforce Scheduler, the appointment appears on the Salesforce calendar and the external calendar.

Events created or edited directly on the external calendar don’t appear on or sync to the Salesforce calendar.

Salesforce Scheduler

External calendar to Salesforce calendar

Events created or edited directly on the external calendar appear on and sync to the Salesforce calendar.

Events on the Salesforce calendar, including service appointments created or edited in Salesforce Scheduler, don’t sync to the external calendar.

External calendar

Bidirectional

This sync direction is commonly used with Salesforce Scheduler. All events on the Salesforce calendar are synced to the external calendar and vice versa.

When you enable Event Management, Salesforce Scheduler writes appointments as events on the Salesforce calendar.

Then, Einstein Activity Capture syncs them to the external calendar.

Events created or edited directly on the external calendar appear on and sync to the Salesforce calendar.

Salesforce Scheduler or external calendar

Based on the sync direction, Matt informs users where to edit the events. He also informs them that they must modify or cancel scheduled service appointments using the modify appointment flow.

Here’s an illustration of data flow after enabling event management and configuring a calendar sync tool.

Corresponding diagram of information.

When you enable Event Management, Salesforce Scheduler shows appointments as events on the Salesforce calendar and updates these events when appointments are updated or deleted. The calendar sync tool then syncs the Salesforce calendar and external exchange servers in near real time based on the sync direction.

Write Appointments to an External Calendar

Einstein Activity Capture sets the sync direction from Salesforce to an external calendar to write Salesforce calendar events to an external calendar. However, there can be cases where Matt wants greater control over the sync process and writes only the service appointments to the external calendar in real time. In such cases, he must publish service appointments as platform events, use event listeners to subscribe to the platform events, and use API classes to update an external calendar. Follow along as Matt explores this approach.

Matt configures settings so that Salesforce Scheduler triggers platform events when users create, update, or delete appointments.

  1. From Setup, in the Quick Find box, enter Salesforce Scheduler, and then select Salesforce Scheduler Settings.
  2. Enable Publish Appointments as Platform Events.The Salesforce Scheduler Settings page with Publish Appointments as Platform Events enabled.

When you enable the Publish Appointments as Platform Events setting, remember these points.

  • Salesforce Scheduler doesn’t generate platform events for time blocked for before and after appointment buffers. Instead, Salesforce Scheduler adds these buffer-related Salesforce calendar events to the appointment event payload.
  • When you enable multi-resource scheduling, only one platform event is generated even if an appointment has multiple attendees.

Matt teams up with the bank’s in-house developer, for the next step. Together, they use the Subscribing to Platform Events developer guide to subscribe to the AppointmentSchedulingEvent platform event with Apex triggers.

Note

As an alternative to Apex triggers, use an EMP Connector, a CometD client, or a third-party connector such as the Salesforce Platform Events Source Connector for Confluent Platform. Check out the Resources section for details on these options.

The last step is to implement APIs to write the platform event changes to the external email server. Because most of the bank’s employees use Outlook, Matt uses the Microsoft Graph REST API to publish the events to Outlook.

Here’s an illustration of how it works.

Corresponding diagram of information.

When you create, update, or delete a service appointment, it triggers a platform event, which then gets published to the external calendar via Apex triggers or Streaming API, also known as CometD.

Know the Calendar Integration Considerations

Matt now knows how to integrate calendars and the considerations for different types of integration.

  • To show Salesforce Scheduler appointments on the Salesforce calendar, enable Event Management.
  • To show Salesforce Scheduler appointments on an external calendar, there are two ways.
    • To update appointments in real time, enable Publish Appointments as Platform Events, and then use event listeners to subscribe to the platform events, and use API classes to update external calendars.
    • To update appointments in near real time using a calendar sync tool, enable Event Management, and then configure a calendar sync tool.

In this unit, you explored calendar integration options. In the next unit, learn how to determine availability on Salesforce and external calendars by configuring scheduling policy rules.

Resources

Share your Trailhead feedback over on Salesforce Help.

We'd love to hear about your experience with Trailhead - you can now access the new feedback form anytime from the Salesforce Help site.

Learn More Continue to Share Feedback