How to automatically associate Events with Contacts on Opportunities to those Opportunities, every time!
Scenario: Sales has a meeting with a Prospect, set by a calendaring program like Calendly, or the Sales Enablement program (Outreach, SalesLoft, or HubSpot Sales), or just manually added to the Activity timeline. Those meetings are always being tied as an Event to the Contact object ONLY. Sales has to manually associate the Event to the Opportunity they’re working with that Contact, if at that stage in the buying journey.
There’s at least 11 clicks to manually set that right – from first searching up the Contact to making sure the Event you just associated appears on the right Opportunity Activity timeline.
Say that Salesforce is feeling chipper that day and it takes 5 seconds after each click for the page/object to load up in the browser. Take another 10 seconds to find the element I need to click or type in. That’s approximately 3-5 minutes for each Event you need to associate.
If you have 5 appointments on your calendar that day that you need to associate with the proper Opportunity; that’s 15-25 minutes of your day, EVERY DAY, doing something that can and ought to be automated.
Imagine your internet was slow that day or your computer isn’t cooperating. What if you got distracted by an inbound sales call or email, or your manager Slacks you and asks for an update on your pipeline? 15 minutes could easily turn into 45 minutes to an hour. Remember, this happens EVERY DAY.
There’s gotta be a better way…
Enter the Flow: Assign Related Opportunity to Event
What you’re gonna do is automatically link up the connection that the Contact will probably have with the Opportunity. Your reps should already be assigning Contact Roles on the Opportunity as you’ve trained them on following best practices. This is essential for the Flow to work!
Best Practice: The moment that a person at a target Account has any interaction with a sales rep at your Company on a deal, that Contact should be assigned a Contact Role on the Opportunity and given a role on the deal: Evaluator, Influencer, Decision Maker, Economic Buyer, etc.
We will trace the connection from the Contact on the Event through Opportunity Contact Role to Get the Opportunity ID and then update the Event record with what we just got. Where it gets tricky is all the uses of the label “Opportunity ID”. Remember that the first Get is on the OCR object and the second Get is from the Opportunity object.
Here’s the steps you should follow to set up your Flow:
- Create a new Flow: Navigate to Setup, and search “Flows” from the Home tab. Click the “New Flow” button.
- Choose the “Record-triggered Flow” template, and click Next. Choose Auto-Layout.
- Select the Event Object. Trigger the Flow when the record is created. No Entry Conditions. Optimize the Flow for Actions and Related Records.
- Add Element: Get Records. You’re trying to store the field OpportunityId from the Opportunity Contact Role Object.
- Label it something like “Get OCR”.
- Get records of the Object: Opportunity Contact Role.
- Filter the OCR records where the field “ContactId” on the OCR equals the ContactId on the Event (“$Record.Contact_ID__c”, or something close to it).
- Sort Descending by Contact Role ID
- Store just the first record, and store a single field as a brand new variable (bottom option both times): “OpportunityId” as CopyOCROppId
- Click Done.
- Add Element: Get Records. On this second Get, you’re trying to store the fields OpportunityId from the Opportunity Object.
- Label it something like “Get OppId”
- Get records of the Object: Opportunity.
- Filter the Opportunity records where the field “Opportunity ID” on the Opportunity equals the variable you just saved from the OCR: CopyOCROppId.
- Sort Descending by Created Date. This will ensure only the most recently created Opportunity the Contact may be associated with will be selected.
- Store the first record like you did in the previous step, as a brand new variable: “OpportunityId” as CopyOppId.
- Click Done.
- Add Element: Update Records.
- Label it something like “Update Event with OppId”
- Use the event that triggered the Flow as the thing you want to Update and set values.
- No Filter Conditions
- Field: Related To Id: “WhatId” is updated with the value stored in “CopyOppId”
- Click Done.
- End Flow.
Save and Activate your new flow. Test it out! Any time an Event is created from any source, if the Contact is listed as a Contact Role on an Opportunity, the Flow will automatically associate that Opportunity to the Event.
With this Flow, your reps should save HOURS monthly on needless admin work in Salesforce. This frees them up for more selling time and hopefully will put more money in the bank for your company.
Cheers!
Zach is a Revenue Operations Expert with over 7 years of experience in Operations and early-stage, venture-backed, high-tech B2B SaaS. He has a strong background in Sales and Systems gained through his time in healthcare technology and telecom. He holds a bachelor’s Degree in Business Administration and is a 3x certified Salesforce professional. Zach is passionate about startup business growth and enjoys helping readers by providing insights on gaining higher efficiency and greater effectiveness within revenue and operations teams.