You can automate your SMS messages in Salesforce via Flows. This article will walk through how to add an SMS message action to a flow.
NOTE: There are 3 automation tools used in Salesforce: Workflow Rules, Process Builder, and Flows. Salesforce has announced they'll be retiring Workflow Rules and Process Builder in the near future. Based on this, we recommend only using Flows to automate SMS messages.
SMS message actions can be added to any kind of flow. For help creating a flow, see this Salesforce article.
Adding SMS to the Flow
Before you get started, there're some important things to consider:
- The way an SMS message is triggered in a flow is by creating a task record with specific values.
- SMS messages triggered by flows must use a template, so you'll need to use an existing template when creating the task record.
1. Add a Create Records Action to your flow.
2. Configure the Create Records Action as follows:
|API Name||User preference|
|How Many Records to Create||One|
|How to Set the Record Fields||Use separate resources, and literal values|
3. In the Set Field Values for the Task section, add and set the following fields and values:
|ActivityDate||$Flow > Current Date|
Note - Replace SMS_Code with the SMS Code found on the desired SMS Template as shown below. Include the quotations, colon, and brackets. The template chosen will define the Send from account and message content.
|OwnerId||The ID of the user that should be logged as sending the message|
|WhoId||The ID of the person object (contact or lead) the message is related to|
The WhatId field can be optionally used in conjunction with the WhoId field to add a related record other than a lead or contact (e.g. account, opportunity, etc.).
Note - If your organization uses Person Accounts in Salesforce, the WhatId field should be used in place of the WhoId field and would become mandatory.
4. Now all that's left to do is click Done and Save, and your Flow is ready to go.
Note - we recommend the flow is debugged and/or tested prior to activation.