Syncing Calendly routing form responses to Salesforce

Overview

Calendly sends and stores Calendly routing form responses in Salesforce, automating creating/updating Salesforce records (by default, contacts and leads). This makes it easier to centralize reporting, while also enabling retargeting a qualified lead who didn't book a meeting.

To learn more about routing forms, check out Getting started with Routing Forms

Note: Syncing Calendly routing form responses to Salesforce is included in package version 2.4 or higher. If you are unsure of what version you currently use, visit your Salesforce integrations page to confirm your version.  

This functionality is not for organizations using Marketo, HubSpot, or Pardot form integrations. For those using these integrations, utilize the Marketo, HubSpot, or Pardot to Salesforce integrations to sync your form responses into Salesforce. 

How it works 

When a Calendly routing form is submitted, the Salesforce integration creates a CalendlyRoutingFormSubmission record and a CalendlyRoutingFormQuestionsAnswers record for each question asked on the form. The creation of the CalendlyRoutingFormSubmission record triggers the flow CreateRoutingFormLeadTemplate

Note: While multiple records are created in Salesforce for each routing form submission, it is conducted in a single API request using Salesofrce composite api. This approach helps prevent customers from reaching API limits.    

This flow is fully customizable, but works in the following way by default: 

If there is an SFID present 
  1. The flow looks for a contact that matches the SFID.
    • If the flow finds a contact, it associates the form submission to the contact by updating the Calendly Contact field on the CalendlyRoutingFormSubmission record to the Contact ID.
    • If the flow does not find a contact, it looks for a lead that matches the SFID.
      • If the flow finds a lead, it associates the form submission to the contact by updating the Calendly Lead field on the CalendlyRoutingFormSubmission record to the Lead ID.
If there is no SFID present
  1. The flow loops through the CalendlyRoutingFormQuestionsAnswers records related to the CalendlyRoutingFormSubmission until it finds a name question. This will be the lead's name if the flow can't find a record matching an email address.
  2. The flow then loops through the CalendlyRoutingFormQuestionsAnswers records related to the CalendlyRoutingFormSubmission until it finds an email question. This will be the email address the flow uses to look for a matching record and if the flow can't find one, this will be the new lead's email.
    • If the flow can't find an email, it ends since the flow won't create a Lead by default without an email address.
    • If the flow finds an email: 
      • It looks for a contact that matches the email address. 
        • If the flow finds a contact, it associates the form submission to the contact by updating the Calendly Contact field on the CalendlyRoutingFormSubmission record to the Lead ID
        • If the flow does not find a contact, it creates a new lead that will be owned by an active system admin. 
          Routing.png
        • The flow then associates the form submission to the lead by updating the Calendly Lead field on the CalendlyRoutingFormSubmission record to the Lead ID.
Additional important information

There is a FormSubmissionsUUID field on the Calendly field on the CalendlyAction object.

While the above custom object and flow is only triggered by the Calendly-hosted forms not integrated behind a marketing automation tool form (Pardot, Marketo, Hubspot), we will still pass a value to this field on the CalendlyAction object if the event was scheduled after the invitee completed any form that was in front of a Calendly routing rule.

This means if you want to handle events from a form differently from events booked by directly visiting a Calendly link, you can customize your CreateEventTemplate flow to branch based on whether or not this field is null. 

Tip

To use a Salesforce ID in a routing form submission for looking up existing records, append "?salesforce_uuid=<ID>" to the end of your routing form link. This will store the Salesforce ID in the SalesforceId field on the CalendlyRoutingFormSubmission record.

Example: https://calendly.com/your_form?salesforce_uuid=123abc