All businesses need to stay in touch with their clients and prospects to keep growing their pipeline. It is critical for businesses to maintain regular contact with the prospective clients. This article discusses a possible approach for implementing such a requirement.
Identify all contacts that have not been touched in six months. That is find the contacts for which no activity (calls, emails) has happened in the last six months. For these contacts we need to do two things:
- Send an email to the Salesforce user that owns the contact to be in touch with the contact.
- Create a log a call task for the same user.
Salesforce Flow or Salesforce Flow builder is a powerful automation tool that can automate complex business requirements without writing a single line of code. We can create a flow using Salesforce Flow Builder and automate this using Schedule-Triggered Flow.
Here is the step-by-step process to make a flow:
- First, we’ll get all the task records using the “Get Records” element with the subject “Call” or “Email”
Figure 1: Get all the task records
Figure 2: Filter the task records with subject
- We need a variable to hold contact IDs for the records that are associated with the task. So, we’ll create a variable using the “New Resource” of the text type.
Figure 3: Text variable to store contact IDs
- Next, we take a “Loop” element to iterate over the task records we just fetched.
Figure 4: Loop to iterate over the task records
- Then, we’ll take a “Decision” element to check whether the variable “ContactIDs” we created above in step 2 already contains the contact ID. We had to do this in order to get unique contact IDs. If there is a case that a single contact has multiple tasks associated with it, our flow will send multiple emails to the user. But we don’t want to send multiple emails, we’ll send a single email to the contact’s woner for any task associated with it.
Figure 5: Decision to check if contact ID already exist in the variable
Figure 6: Decision condition for contacts to filter duplicate contacts
- If contact ID is not already present, we’ll add it using the “Assignment” element to the variable “ContactIDs”.
Figure 7: Assignment element to add contact ID if it is not already present.
- Next, we’ll create a formula of the Date type and get the no activity date for the last six months.
Figure 8: Formula to dynamically get the date (last six month)
- After that, we’ll get all the contacts which no activity has happened in the last six months OR no activity has happened since the contact was created.
Figure 9: Get all the contact records
Figure 10: Filter condition for the contact records
- Next, we’ll add a loop that will iterate over the newly fetched contacts.
Figure 11: Loop to iterate over contact records
- Now, take a decision if contacts IDs already present in our variable or if no activity has happened.
Figure 12: Decision to check if contact ID exist to send an email
- Once we get our conditions satisfied, we’ll take action to send email to the contact’s owner specifying the subject, body, and email addresses.
Figure 13: Email action to send email to contact’s owner
- As per the second requirement of the client, we’ll create a task for every contact using the “Action” element.
Figure 14: Task action to create a task with subject Call associated to that contact
- Now, connect all the elements on the canvas as shown below.
Figure 15: Connect all the elements on the canvas
- Finally, schedule and save your flow.
Figure 16: Schedule the flow
In this blog we looked at a business need to remind the salesperson who owns the contact, where no activity has been performed with the contact in six months.
For any query, contact email@example.com