The TextUs integration for Salesforce allows you to customize task objects to automatically add “Inbound Text” or “Outbound Text” to the subject line of each text message to help your users categorize and organize their logged text messages in Salesforce.
This guide provides you with instructions on how to create a record-triggered flow that stamps information on the subject line for every sent or received text message task in Salesforce. For more information on how record-triggered flows work, see the Salesforce knowledge base.
Note: Before you can build a record-triggered flow, you need to integrate TextUs and Salesforce and set up your API key. For more information, see How to set up your Salesforce integration.
How it works
Note: Your Salesforce admin should complete the steps in this guide to ensure your integration has the correct account settings and permissions.
To create tasks with predefined subject values in your Salesforce integration, complete the following steps:
Step 1: Create a record-triggered flow
Note: The steps in this section use the Free-Form view on the Flow Builder page. You can switch between the Free-Form and Auto-Layout views by using the dropdown menu at the top of the Flow Builder page.
First, create your record-triggered flow by completing the following steps:
On the Setup page, enter Flows in the Quick Find search box, then select Flows.
Click New Flow.
Select Record-Triggered Flow, then click Create.
Step 2: Configure the start trigger
Next, configure the trigger and set entry conditions on the Configure Start menu.
In the Object field, enter Task.
Under Configure Trigger, select A record is created.
Under Condition Requirements, select All Conditions Are Met (AND).
Define the first condition so that the flow is triggered for records that have the TextUs Message field and the field contains a value:
Field: tubl_Textus_Message_c
Operator: Is Null
Value: False
In the Optimize this Flow for section, select Fast Field Updates.
Click Done.
Step 3: Configure the Get Records element
Next you'll need to find Salesforce records that meet filter conditions, and store values from the records in variables.
In the Toolbox on the left sidebar, click the Elements tab, then drag the Get Records icon to your Flow Builder.
You'll need to find and store the records for the Custom setting that contains the Text Task Subject configuration for TextUs Client Application. In the TextUs Custom Settings, you have the ability to customize the value listed. The default is set to "Text".
On the New Get Records view, enter the following information:
Label: Get Custom Settings
Object: TextUs Settings
Under Filter TextUs Settings Records:
Set the Field value to tubl_TaskSubject_c
Set the Operator to Is Null
Set the Value to FALSE
Click Done.
On the Flow Builder page, connect the Start element to the Get records icon.
Step 4: Set the Decision element
Now that you have created your flow, use the steps below to set the Decision element and connect it to the start trigger.
On the Toolbox left sidebar, click the Elements tab, then drag and drop the Decision icon to your Flow Builder.
On the New Decision view, enter the following information:
Label: Check Subject Settings
API Name: This field auto-populates with the API name.
Description: Enter an optional description.
Under Outcome Details, enter the following information:
Label: Subject Match
API Name: This field auto-populates with the API name.
Condition Requirements to Execute Outcome: Select All Conditions Are Met (AND)
Resource: Record.Subject
Operator: Equals
Value: Get_Custom_Settings.tubl__TaskSubject__c
On the Default Outcome tab, use the default settings. If the default outcome occurs, the flow will be complete and will not perform any other action.
Click Done to update your settings.
Step 4: Edit the formula variables
Before your integration can modify the subject line of a task, it needs to determine if the text is inbound or outbound using the following formula variable settings:
On the left-hand side under the toolbox, go to the Manager tab and click New Resource.
Update the information on the New Resource view:
Resource Type: Formula
API name: Subject_Auto
Data Type: Text
Click Done.
Step 5: Update the records
On the Toolbox left sidebar, click the Elements tab, then drag and drop the Update Records icon to your Flow Builder.
Update the information on the New Update Records view:
Label: Update Subject Line
API Name: Update_Subject_Line
Description: Enter an optional description.
Under How to Find Records to Update and Set Their Values, select Use the task record that triggered the flow.
On the Condition Requirements to Update Record dropdown menu, select None- Always Update Record.
Update the information under Set Field Values for the Task Record:
Field: Subject
Value: Subject_Auto
Click Done.
Step 6: Connect and test the flow
On the Flow Builder page, click the circle at the bottom of the Decision icon and drag the gray line to connect it to the Update Record icon, select the outcome as Subject Match, then click Done. When you are finished, click the Save button to update your flow.
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.
Step 7: Activate the flow
When you’ve finished testing your flow and you are ready to make your record-triggered flow live, click the Activate button.
All logged text messages should now be stamped as inbound or outbound once the task is created. Any previous records will need to be manually modified if desired.