Process Builder: Send Alerts or Change Record Status if there has been no Activity in a while

Note: If you are not familiar with Process Builder and creating automations, please familiarize yourself with the tool e.g. by reading this trailhead

Example 1: Update Record Status if there has not been client activity for a while

 

Situation:

You have new incoming contacts or requests that have not been taken care of in a certain time and want to be informed or inform someone about it or you want to change the status of a record if there has not been an activity with it for a while (a contact goes stale, an offer expires, a closing

 

In the following example, you want to show, e.g. in a path, that the contact has not been contacted for a while concerning his active request and hence want the system to change the status if the last activity has been longer than 30 days ago.
So the system can use the activity's date related to the request record to set that planned status change if nothing else happens in the meantime.

 

You will need some additional fields to support the automation. This overview breaks down the entire setup needed:

​​​​
So, following the above in overview these are the steps:

On the object (request) you want the change to happen create 3 custom fields - none of them have to be on the page layout, but it might be helpful during initial setup:

- a Date field to capture Last Activity, so e.g.
Last Activity Date (Process Builder)” (Date field! Not formula!)

- a Date field that will trigger the rule, so e.g.
Rule Date(Process Builder)

- a Checkbox field e.g.
Process Helper” (or PB Helper)

Then create two process builder rules:
Process 1 -> Task

  1. When a task is created or edited
  2. Criteria: task status = completed AND task related to ID starts with "a0Q" ->Note: to identify what characters your object's records start with, find a record (in our example "request") and copy the first 3 characters of a record ID from the URL. This is different from ORG to ORG.
  3. Action 1: If "Process Helper" (PB Helper) = FALSE AND Status = Active, then update

    - Last Activity Date (Process Builder) to Task Date (e.g. CompletedDate, so when the task was completed, but you can also use other available date fields depending on your goal)
    - Rule Date (Process Builder) to TODAY() (formula)
    - Process Helper to Boolean = TRUE


    Action 2: 
    If "Process Helper" (PB Helper) = TRUE AND Status = Active, then update

    - Last Activity Date (Process Builder) to Task Date (e.g. CompletedDate so when the task was completed, but you can also use other available date fields depending on your goal)
    - Rule Date (Process Builder) to TODAY() (formula)
    - Process Helper to Boolean = FALSE

    ​The last two actions are redundant, but required like that in order to trigger either way an activity change comes through.


Process 2 -> Request

So, now that the activity updates the request, the request can plan the status change:

  1. When a request is created or edited
  2. Criteria1: 
    if Status = Active
    AND Rule Date (Process Builder) = TODAY() 
    AND Process Helper(PB Helper) = FALSE 

  3. Set SCHEDULED ACTIONS: 30 Days after
    Last_Activity_Date_Transfer_ProcessBuilder__c


    Add Action: update Status to "Lost"

  4. Criteria2:
    IF Status = Active
    AND Rule Date (Process Builder) = TODAY()
    AND Process Helper(PB Helper) = TRUE

  5. Set SCHEDULED ACTIONS: 30 Days After Last_Activity_Date_Transfer_ProcessBuilder__c

    Add Action: 
    update Status to "Lost"


This will create a routine for 1 status change. You can enhance this with additional time-based actions for other time periods and status changes, so you would repeat point 3 and 5 above for +60 and +90 days. Or even add an Email Alert action to inform someone about it.


Why this complex setup? The rules only run when something changes on a record. So, if you reach more than e.g. 60 days of no activities, it could also mean that the record also wasn't touched during this period. So you must create all updates right from the first time the record is created and every time the alerts should reset. Then, if an activity happens, the planned action is also updated to a new date +30, +60, +90 days.

Btw, you can then see these planned actions in Setup>Flows ->Paused and Waiting Interviews

 

Example 2: Send an Email Alert if a new request remains untouched for X days

Another example: You want to be informed if there has not been an activity for a new request within the first couple of days. 

 

Requirements:
Similar as in previous example, you will need the helper field "Last Activity Date (Process Builder) in order to check if there has been any activity.
You will also want to prepare an Email Alert and the corresponding Email Template.

Process Builder Rule 2: Create a timed Email Alert when a Request is created and sends it if request activities (no last activity date) remain untouched

Step 1: Create a new Process Builder Rule with "When a record changes". Then select the object, in our example this will be "Request" and let the rule start "when a request is created or edited". Allow recursions:

2019-05-03_13-09-29.png

Step 2: Criteria
The following criteria ensure that the Email Alert is only sent when there is no "Last Activity Date (Process Builder)" set (field is empty) and the related contact's "Last Activity Date" is less than the Request's "Created Date".
The latter is optional and useful when you want to ensure that the agent has not been in touch perhaps via the contact (by email or another task) and simply didn't create a task related to the request.

So
If Last Activity Date (Process Builder) is null -> (boolean) TRUE
AND related contact's Last Activity Date is less than the request's Created Date

 

2019-05-03_13-10-54.png

Step 3: Set Time Offset when the Alert should be sent. Start with a smaller period, so you can easily test the outcome. Once all is working as desired, updating the number with your targeted time period in a cloned version of this process will be quickly done.

2019-05-03_13-11-45.png

Step 4: Add the Email Alert Action. Note: if you haven't prepared the Email Alert yet, please do so now. Remember: the alert will also require a Salesforce "Email Template", so the content you will send out.

2019-05-03_13-12-03.png

 

Process Builder Rule 2: a related Task updates Request's "Last Activity Date (Process Builder)" to stop first rule from triggering

Step1: Create a Process Builder Rule
that runs when a task is added and it updates "Last Activity Date (Process Builder)" on the related request, it stops the Email Alert from being sent as foregoing rule requires the date field to be empty.

2019-05-03_13-08-40.png

Step 2: Criteria
Ensures that the task is really related to a request and only runs then, so "related to ID (aka WhatID) starts with a0Q".
->Note: to identify what characters your object's records start with, find a record (in our example "request") and copy the first 3 characters of a record ID from the URL. This is different from ORG to ORG.

2019-05-03_13-08-52.png

Step 3: Add Action updating "Last Activity Date (Process Builder)" field to e.g. the tasks Created Date. You can also use e.g. "Completed Date" if you want to only exclude the alert when an agent really has completed the task. That depends on your business setup and how you evaluate activities in this sense.

2019-05-03_13-09-06.png


Btw, you can then see these planned actions in Setup>Flows ->Paused and Waiting Interviews

FAQ

Q: How can I find the related records ID to identify what it starts with?
A:  To identify what characters your object's records start with, find a record and copy the first 3 characters of the record ID from the URL:

2019-05-06_14-52-42.png

 

Powered by Zendesk