Skip to main content
All CollectionsIntegrationsSalesforce
How to create predefined subjects for tasks in your Salesforce integration
How to create predefined subjects for tasks in your Salesforce integration
Updated over 8 months ago

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:

  1. On the Setup page, enter Flows in the Quick Find search box, then select Flows.

  2. Click New Flow.

  3. 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.

  1. In the Object field, enter Task.

  2. Under Configure Trigger, select A record is created.

  3. Under Condition Requirements, select All Conditions Are Met (AND).

  4. 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

  5. In the Optimize this Flow for section, select Fast Field Updates.

  6. 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.

  1. In the Toolbox on the left sidebar, click the Elements tab, then drag the Get Records icon to your Flow Builder.

    1. 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".

  2. On the New Get Records view, enter the following information:

    1. Label: Get Custom Settings

    2. Object: TextUs Settings

    3. Under Filter TextUs Settings Records:

      1. Set the Field value to tubl_TaskSubject_c

      2. Set the Operator to Is Null

      3. Set the Value to FALSE

    4. Click Done.

  3. 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.

  1. On the Toolbox left sidebar, click the Elements tab, then drag and drop the Decision icon to your Flow Builder.

  2. 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.

  3. 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

  4. 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.

  5. 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:

  1. On the left-hand side under the toolbox, go to the Manager tab and click New Resource.

  2. Update the information on the New Resource view:

    • Resource Type: Formula

    • API name: Subject_Auto

    • Data Type: Text

  3. Click Done.

Step 5: Update the records

  1. On the Toolbox left sidebar, click the Elements tab, then drag and drop the Update Records icon to your Flow Builder.

  2. Update the information on the New Update Records view:

    • Label: Update Subject Line

    • API Name: Update_Subject_Line

    • Description: Enter an optional description.

  3. Under How to Find Records to Update and Set Their Values, select Use the task record that triggered the flow.

  4. On the Condition Requirements to Update Record dropdown menu, select None- Always Update Record.

  5. Update the information under Set Field Values for the Task Record:

    • Field: Subject

    • Value: Subject_Auto

  6. 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.

Did this answer your question?