How to sync Calendly routing responses to Salesforce

Calendly syncs routing form responses to Salesforce, automating contact/lead updates and centralizing reporting, while enabling lead retargeting.

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

This feature isn't for organizations using Marketo, HubSpot, or Pardot forms. Use their integrations with Salesforce to sync form responses.

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

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: Multiple records are created in Salesforce for each routing form submission in a single API request using Salesforce's composite API, helping avoid hitting API limits.

Default flow

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

The FormSubmissionsUUID field is on the CalendlyAction object. While this custom object and flow only trigger for Calendly-hosted forms (not those integrated with Pardot, Marketo, or HubSpot), we still pass a value to this field if the event was scheduled after completing a form that followed a Calendly routing rule.

This lets you customize the CreateEventTemplate flow to treat events from a form differently than those booked directly via a Calendly link by checking if 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