cloudraysolutions.com

This post is in collaboration with Gorav Seth who patiently led me step by step to mastering this magic! His blog post includes some screenshots (using the event object) of the steps involved. Thanks, Gorav!

***

Wouldn’t it be great to get a reminder when a task is due…Like, an email straight to your inbox alerting you, ” Hey you! This task is due in an hour!”…Unfortunately, this is not native for Salesforce and that’s when you need to wrap your head around alternative Salesforce capabilities to do what you want. Thankfully, I stumbled upon a thread where this exact issue what being discussed.

In this example, we will create a simple reminder for a task related to a contact.

What we want: An email reminder one hour before a task is due.

What we need to do: Use process builder to launch a flow that will send the email.*

HERE’S HOW

1. Create a flow – Go to Setup>Create>Workflow & Approvals>Flows> New Flow

2. Lookup Task – From the left palette, drag the “Fast Lookup” element onto your canvas (big screen area)

  • Name: Lookup Event
  • Unique Name: Autopopulates
  • Lookup: Task
  • Criteria: Field = Id, Operator = equals, Value = vaTaskId

The value vaTaskId is a new variable you will create to match up the task in question to work with this flow. We will later use it to reference the task in process builder.

  • Variable: sovTask

This time, you are creating an sObject Variable to store the results of the lookup. This is basically a representation of your task, in memory, which you can later reference for the email.

  • Fields: Select the fields that you would like to hold and later reference.
  • Click Ok

3. Lookup Contact – From the left palette, drag the “Fast Lookup” element onto your canvas (big screen area)

  • Name: Lookup Contact
  • Unique Name: Autopopulates
  • Lookup: Contact
  • Criteria: Field = Id, Operator = equals, Value = {!sovTask.WhoId}

Because we have “saved” the task, we can now refer to it’s field and match up the correct contact associated with that task.

  • Fields: Select the fields that you would like to hold and later reference (e.g. FirstName, LastName)
  • Click OK

**Option to have a lookup step to grab the task owner/assigned to info and use that to send the email. For now, we’ll skip it and just assign the email manually.**

4. Send email –  From the left palette, drag the “Send email” element onto your canvas (big screen area)

  • Name: Send Reminder Email
  • Unique Name: Autopopulates

For the body and subject, we will create text templates using variables from the task we previously referenced and held.

  • Add row > Select Email Addresses (comma-separated), and enter the email of the desired recipient (or reference the email of the owner if you have referenced it earlier)
  •  Click OK

5. Connect the screens– Going in order of the screens, click on the little node on the bottom and drag it to the next element. Then go to the first screen (fast task lookup) and click on the little green icon to set it as the first step.

6. Save – Save your flow and give it a name! Ensure that the type is set to auto-launched. Press OK. Close and then activate your flow

There! We have created the flow to send an email reminder….now we need to launch the flow!

7. Open Process Builder – Go to Setup>Create>Workflow & Approvals>Process Builder> New

  • Name: Activate Task Reminder
  • Api Name: Autopopulates
  • Click Save

8. Select the Task object – Click on the rectangle “Add Object” and select task in the right panel.

  • Save

9. Add Criteria – Click on the add criteria Shape. In my example, we want it to fire when the reminder field is checked off.

  • Name: Task Criteria
  • Criteria: Conditions are met
  • Conditions: field = reminder set, operator = equals, type = boolean, value = True
  • Save

10. Schedule the action – In the scheduled action rectangle, click on set schedule.

  • 1 hours before Reminder date/time
  • Save

11. Add the action – Click on add action (below scheduled actions)

  • Action: Select Flows
  • Action Name: Launch Flow Email
  • Flow: Select the flow you just created
  • Set Flow Variables by clicking add row: variable = vaTaskId, type = reference, value = Activity ID
  • Save

12. Activate your flow

That’s it it takes!

Enjoy the wonderful and magical fruits of your labor.

——

* In case you’re wondering why we don’t use Workflow rules, you can’t send email alerts as a workflow action.

—–

Resources:

http://goravseth.clarify-it.com/d/nhpcx4

Leave a Reply

Your email address will not be published. Required fields are marked *