Update the Salesforce lead owner to match the event owner


If an invitee already exists in Salesforce, Salesforce will create a new event and assign the event to the Calendly user. However, the flow does not automatically update the lead owner, so the existing lead owner will remain the same. 

Follow the steps in this article if you'd like to update the existing lead owner to match the assigned event owner from Calendly. To read more about default flow behavior, view Default behavior of the Salesforce package.

Example use case

You may want to update who owns a lead because the lead is moving into a different stage of the sales cycle. To do so, you'd need to add additional elements in the flow to update the lead owner to the Calendly event owner. 

How to update the Salesforce lead owner to match the event owner

Note: If you're unsure what version you currently use, you can visit your Salesforce integrations page to confirm your version. 

Version 2.5 Version 2 Version 1.1

Step 1: Locate your flow

  1. In Salesforce Setup, search for Flows. Select Flows.
    • If you haven't customized the CreateEventTemplate before, you'll need to create a new flow based on the template. To do so, you can open the CreateEventTemplate, customize it directly, then Save as. Saving it will create a new flow. You can call the new flow something like "CreateEvent."
    • If you've already customized the flows, then open your customized flow.

Step 2: Add a Decision element

  1. From the Toolbox on the left-hand side, drag a Decision element to the far right of the flow, next to the Create Records: Create Event element.
  2. At New Decision, set Label to Lead Match to update.
  3. Under Outcome details, set the Label to Lead Match to Update Record Owner.
  4. Under Condition Requirements to Execute Outcome, select All Conditions Are Met. You'll set up 3 conditions.
    1. For the first condition:
      • At Resource, select WhoRecordId.
      • At Operator, select Does Not Equal
      • At Value, select $GlobalConstant.EmptyString.
    2. Select, + Add Condition. For the second condition:
      • At Resource, select LeadConvertedAt.
      • At Operator, select Is Null
      • At Value select $GlobalConstant.True.
    3. Select, + Add Condition. For the third condition:
      • At Resource, enter WhoRecordId.
      • At Operator, select Is Null
      • At Value, select $GlobalConstant.False.SF-New_decision.png
  5. Select Done.

Step 3: Add an Update Records element

  1. From the Toolbox on the left-hand side, drag an Update Records element to the far right of the flow next to the Decision, Lead Match to Update element.
  2. At New Update Records, set Label to Update Lead Owner
  3. Under How to Find Records to Update and Set Their Values, select Specify conditions to identify records, and set fields individually.
  4. Under Update Records of This Object Type, at Object, select Lead.
  5. At Filter Lead Records, at Condition Requirements to Update Records, select All Conditions are Met. You'll set up a condition:
    • At Field, select Id.
    • At Operator, select Equals.
    • At Value, select WhoRecordId.
  6. At Set Field Values for the Lead Records, you'll set up a field.
    • At Field, select OwnerId.
    • At Value, select OwnerId
  7. Select Done.

Step 4: Connect the elements

  1. Connect the Subflow: Create Event Attendee Template element to the Decision: Lead Match to update element.
  2. Connect the Decision: Lead Match to update element to the Update Records: Update Lead Owner element.
  3. For the Select Outcome for Decision Controller popup, leave the Outcome as Lead Match to Update Record Owner, and select Done.
    Salesforce Flow.jpg

Step 5: Save and activate the flow

  1. Select Save As, then A New Version, then Save.
  2. To activate your flow, select Activate.
    Note: you will also need to deactivate the CreateEventTemplate, so you don’t have duplicate events in Salesforce.