The TextUs integration for Salesforce allows you to build a custom record-triggered flow that automatically sends SMS text messages when a record in your Salesforce account is created, updated, or deleted using specific criteria.
What’s a record-triggered flow?
Record-triggered flows are used to automatically perform actions in Salesforce behind the scenes when a record is changed in a specific way. Record-triggered flows consist of a trigger, at least one criterion, and at least one action. Simply put, the job of a record-triggered flow is, “If something happens, then do something else.” For more information on record-triggered flows, see the Salesforce knowledge base.
Build your record-triggered flow
Create a message template
Before you create your flow, you'll first need to create a template for the message that you will send. This template will include the content of the message as well as the phone number that it will be sent from (called the "Sender Code" in Salesforce). To create this template record, complete the following steps.
Using the App Launcher in the top left corner, navigate to the TextUs App.
Click the TextUs Message Template tab at the top of the page. Click ‘New.’
In the Sender Code field, add the phone number your contacts or leads will receive the message from.
In the Body field, add the message you want your customers to receive.
If the message contains a link, you may want to check the Shorten Links box.
If desired, you can add an internal description in order to clarify what this template is for. This will not be sent to recipients of the template.
Click Save.
After saving, make note of the template's Record Number. You will need this when you build your flow.
Create a new flow
Now that you've created your message template record, you're ready to create your flow. To do so, complete the following steps:
On the Setup page, enter Flows in the Quick Find search box, then select Flows.
Click New Flow.
Select Start From Scratch and then select Record-Triggered Flow.
Click Create.
Configure the start trigger of your flow depending on your use case. Use filter criteria to target the correct records.
Get Contacts/Leads: Click the plus icon to add an Element to your flow. In the search bar, type and select Get Records as your element type. This element will select the contacts or leads that you want to send your message to. Like you did for the start trigger, use filter criteria to target the desired records.
Get message template: Click the plus icon again to add another Element. Set the element type to Get Records again. This element will retrieve the message template that we created a few minutes ago in the section above. Use the Record Number of the template in order to retrieve it by adding an AND condition and Name Equals [Record Number].
Add Subflow element: Click the plus icon again to add another Element. Under Interaction, click Subflow. From the list of available flows, select TextUs Send Message. Toggle on and configure the following required parameters:
Context_ID: When you click into the field, you should see the label of the Get Record you created in step 6 under Get Records. Click Contact/Lead from [your element label] (the name of this option will appear as a variation of this format depending on the kind of records you're retrieving and what label you chose). Then select Contact ID.
Message_Template: Similarly to the above, once you click into the field you should see TextUs Message Template from [your element label from step 7]. Select this option to use your message template.
Phone_Number: Click Contact/Lead from [your element label] like in step A, then select Business Phone (or another phone number field, if desired). This is the number your message will be sent to.
After you finish creating your record-triggered flow, it’s best practice to debug the flow immediately by clicking the Debug button at the top of the Flow Build page. Testing your flow before activating it lets you try different scenarios without impacting your data.
When you are ready to make your record-triggered flow live, click the Activate button.