Use Case: Update Contact After Logging Emails Or Calls

When I was a Salesforce admin, people asked me many times if we can roll the information of activities up to the contact level. It will be a dream if the roll-up summary can handle that, but it is not possible because activities and contacts do not have a master-detail relationship. It is feasible through some 3rd-party apps, but I haven’t found any that meets my need and is easy to use. (Open for suggestion here!!) So let’s build the solution with flow!

Now many of you might have the solution for calls (Task object) already because there is a lookup (contact) field. We can handle this easily with Process Builder. However, email is really the big problem as they are now a separate object called Email Message. When you check the object, you can’t see the contact lookup either. In fact, there is a junction object called “Email Message Relation” that connects the email and the relevant personnel.

This makes it impossible to build the solution in Process Builder, thus a very good example of what flow can achieve.

* Big thanks to Zhizhi Gabanna for sending in the case!

See fields explanation of:
Email Message
Email Message Relation

Lulu Mobile wants to track how fast their salespeople reach out to the newly-created leads or contacts. They have a field called “First Followup Date”, and they want the system to populate this field whenever they send out an email or log a call. Since it is the first followup date, they only want to update it when the field is not empty.

For calls (Task Object), it is very easy to achieve using Process Builder. For emails, we can only use Flow. To demonstrate, we will build both solutions using Flow. If you want to count Events in, simply clone the flow for Task and change the object to Event.

We will use Record-Triggered Flow to make this happen. The solution will work for both Lead and Contact objects.

Flow 1: Update Lead/Contact When Task Is Logged

task - final flow chart #1

Flow 2: Update Lead/Contact When Email Is Logged

email message - final flow chart #1

Record-TriggeredDecision
Get RecordsUpdate Records

Does the solution solve your problem? If not, write us what your problem is and we will build the flow for you!

Official Salesforce Help Article On Flow

Subscribe
Notify of
guest

16 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Catherine Anthony

Wow! Excellent resource! Thank you for working this out. Well done!

Nick Caines

Brilliant stuff, and very timely, having worked the last 2 weeks on increasing activity views in opportunities this is perfect, with a slight tweak and adding a formula element to plus one to a number field each time the flow completes I now have a live engagement counter on each opportunity. Thank you.

Latha

Email flow#2 described above is not working for Lead. Did that work for you?

Brian Good

I have had something similar in place and now it does not seem to be working, so trying your approach with the Email Message Relation object. My question, you are only checking the ToAddress, what about logging emails when the Contact is sending the email to the user? Would you recommend two paths or two separate flow to check for Contacts / Leads associated with the ToAddress field?

Niko

The flow wasn’t working for me. When I am checking the email message record, the related list “Related To” is empty. Is there any chance you could take a look at it with me?

Gerald

Thank you for this post and the absolutely fantastic website! While the content here no doubt helps advanced admins hone their skills and covers a wide range of use cases, I think the best benefit is enabling beginners to reach a critical mass of confidence and knowledge to figure things out on their own. Flowsome bridges the gap between Trailhead and the real world.

Saif

Thank you for this amazing guide. I wrote my first flow today (Yeah, I’m pretty late to the party) and understood each step perfectly.

Carter Bayer

Thank you for these awesome tutorials, @melody! These are phenomenal.

I am pretty new to SF so I apologize! I’m not able to get a successful flow from this. Granted, my flow is not 100% identical but very similar.

I have a “Last Contacted” date on the Entity/Account record. My goal is for that to update whenever an Email is sent or a Call is logged. I’m not getting any flow run errors, but the date field still does not update. Any ideas??

Here are some screenshots of my flow

Thank you!

Sheila

Thanks so much for this! Very helpful. I do have a question on whether this will work if a single email is sent to multiple Contacts or Leads via Outlook and synced to SFDC using Inbox. I want to be able to update a date field on all Contacts and Leads that were sent the one email. Will the record triggered flow on Email Message created get triggered for each Lead or Contact on the To: and CC: lines of the email? I was wondering because the RelationType is set to “ToAddress”.

Sneha

Can we achieve same with List Emails Sent from contact.