1. Home
  2. TrueDialog Integrations
  3. Salesforce
  4. Messaging
  5. Salesforce – Creating an Incoming SMS Log a Call Flow

Salesforce – Creating an Incoming SMS Log a Call Flow

Salesforce Logo

Salesforce

TrueDialog Integration

System Administrator Permissions Required

The user must be able to create Flows. Contact your system administrator for assistance if you can’t complete these instructions.

The Log A Call On SMS Flow is included with the TrueDialog integration but only works for Contact records. The instructions below will show you how to build a Flow that logs incoming SMS messages to a Task for Opportunity records. Once the Flow is created, the Adding Activity Task List to Opportunity Page sections show you how to display the tasks on your Opportunity page. The instructions in this article are written for the Opportunity object, but they can be applied to other object types. To learn how to use the Log A Call On SMS, see the Salesforce – Using Log a Call On SMS article.

Build Incoming Opportunity SMS Log A Call Flow

This Flow functions in the same way the Log A Call On SMS Flow does for Contacts. The screenshot below shows an overview that explains the Flow’s logical process.

Flow Overview

Create Flow

  1. Click the Settings Gear icon to open the settings menu.
  2. Click Setup.
    Click Setup
  3. Enter flows in the search box.
  4. Click Flows under the Process Automation section.
    Click Flow
  5. Click New Flow.
    Click New Flow
  6. Select Start From Scratch.
  7. Click Next.
    Click Start From Scratch
  8. Select Record-Triggered Flow.
  9. Click Create.
    Click Record-Triggered Flow

Configure Flow

  1. Enter SMS in the Object search box of the Configure Start action.
  2. Click SMS SMS_Integration__SMS__c from the dropdown list.
    Click SMS
  3. Verify that the A record is created option is selected for Trigger the Flow When.
  4. Click the X to close the Configure Start window.
    Select A Record Is Created
  5. Click the Toggle Toolbox button to open the Toolbox sidebar.
  6. Click New Resource.
    Click New Resource
  7. Click the Resource Type dropdown.
  8. Select Text Template from the dropdown list.
    Select Text Template
  9. Enter a name for the resource in the API Name textbox.
  10. Click the View as dropdown on the right of the Body section.
  11. Select View as Plain Text.
    Select View as Plain Text
  12. Copy and paste the following text into the Body textbox.
Type: {!$Record.SMS_Integration__Message_Tpye__c}
Created: {!$Record.CreatedDate}
Message: {!$Record.SMS_Integration__Incoming_Message__c} {!$Record.SMS_Integration__Outgoing_Message__c}
  1. Click Done.
    Enter Body

Sort by Opportunity Record

  1. Click the circle of the connector between the Start and End elements to add a new Element.
  2. Click the Decision element in the Logic section of the Add Element menu.
    Click Decision
  3. Enter a name for the Decision in the Label textbox.
  4. Click the API Name textbox to auto-populate it with the Label with spaces replaced by underscores.
  5. Enter a name for the Outcome in the Label textbox.
  6. Click the Outcome API Name textbox to auto-populate it with the Label with spaces replaced by underscores.
    Enter Label and API Name
  7. Enter sms in the Resource search box.
  8. Click the Triggering SMS_Integr… resource. This is the Record resource variable from the Record-Triggered Flow Start element.
    Click Triggering SMS_Integration
  9. Without moving the cursor or removing what has been filled in the Resource search box, enter opportunity.
  10. Click the Opportunity text resource (Aa icon).
    Click Opportunity
  11. The Resource search box should look like the screenshot below. Alternatively, you can enter {!$Record.SMS_Integration__Opportunity__c} in the search box.
    Completed Resource Field
  12. Click the Operator dropdown.
  13. Select Is Null.
    Click Is Null
  14. Click the Value search box.
  15. Click False under the Global Constants.
    Click False
  16. The completed Outcome Condition should look like the screenshot below.

    The logic for this Outcome is to:
    Check the SMS message record to see if the Opportunity field is not Null. If the Opportunity field contains a value, then the SMS message record was sent from an Opportunity contact.

  17. Click the X to close the Decision window.
    Completed Outcome Condition
  18. Click the circle of the connector between the Default Outcome of the Decision element and the End element to add a new Element.
  19. Click the End element in the Logic section of the Add Element menu.
    Click End

Get Opportunity Record

  1. Click the circle of the connector between the Is Opportunity of the Decision element and the End element to add a new Element.
  2. Click the Get Records element in the Data section of the Add Element menu.
    Click Get Records
  3. Enter a name for the Get Records in the Label textbox.
  4. Click the API Name textbox to auto-populate it with the Label with spaces replaced by underscores.
    Enter Label and API Name
  5. Enter opportunity in the Object search box in the Get Records of This Object section.
  6. Click Opportunity.
    Click Opportunity
  7. Enter id in the Field search box in the Filter Opportunity Records section.
    Click Id
  8. Leave the Operator dropdown set to Equals.
  9. Enter sms in the Value search box.
  10. Click $Record SMS_Integration__SMS__c under Global Variables.
    Click SMS_Integration__SMS__c
  11. Without moving the cursor or removing what has been filled in the Value search box, enter opportunity.
  12. Click the SMS_Integration__Opportunity__c text resource (Aa icon).
    Click Opportunity
  13. The Value search box should look like the screenshot below. Alternatively, you can enter {!$Record.SMS_Integration__Opportunity__c} in the search box.
  14. Click the X to close the Get Records window.
    Completed Value Field

Sort by Active User

  1. Click the circle of the connector between the Get Records and End elements to add a new Element.
  2. Click the Decision element in the Logic section of the Add Element menu.
    Click Decision
  3. Enter a name for the Decision in the Label textbox.
  4. Click the API Name textbox to auto-populate it with the Label with spaces replaced by underscores.
  5. Enter a name for the Outcome in the Label textbox.
  6. Click the Outcome API Name textbox to auto-populate it with the Label with spaces replaced by underscores.
    Enter Label and API Name
  7. Enter opportunity in the Resource search box.
  8. Click the Opportunity from Get… resource under Get Records.
    Click Opportunity
  9. Without moving the cursor or removing what has been filled in the Resource search box, enter owner.
  10. Click the Owner ID record resource (Clipboard icon).
    Click Owner ID
  11. Without moving the cursor or removing what has been filled in the Resource search box, enter active.
  12. Click the Active boolean resource (Togle icon).
    Click Active
  13. The Resource search box should look like the screenshot below. Alternatively, you can enter {!Get_Opportunity_Record.Owner.IsActive} in the search box.
    Completed Resource Field
  14. Leave the Operator dropdown set to Equals.
  15. Click the Value search box.
  16. Click True under the Global Constants.
    Click True
  17. The completed Outcome Condition should look like the screenshot below.

    The logic for this Outcome is to:
    Check the Opportunity record to see if the Owner is Active.

  18. Click the X to close the Decision window.
    Completed Outcome Logic
  19. Click the circle of the connector between the Default Outcome of the Decision element and the End element to add a new Element.
  20. Click the End element in the Logic section of the Add Element menu.
    Click End

Create a Log a Call Record

  1. Click the circle of the connector between the Is Active User of the Decision element and the End element to add a new Element.
  2. Click the Create Records element in the Data section of the Add Element menu.
    Click Create Records
  3. Enter a name for the Create Records in the Label textbox.
  4. Click the API Name textbox to auto-populate it with the Label with spaces replaced by underscores.
    Enter Label and API Name
  5. Click the How to set record field values dropdown.
  6. Select Manually.
    Click Manually
  7. Enter Task in the Object search box.
  8. Click Task from the list.
    Click Task

Add six Field and Value pairs for this Task object. The instructions below show you how to add a single Field and Value pair. You can repeat this process using the table below to create the rest of the Field and Value pairs.

  1. Copy ActivityDate from the Field column of the table below to the Field search box.
  2. Click ActivityDate from the list.
    Click ActivityDate
  3. Copy {!$Record.CreatedDate} from the Value column of the table below to the Value search box.
  4. Click CreatedDate from the list.
    Click Created Date
  5. Click Add Field to add another Field and Value pair.
    Click Add Field
  6. Repeat this process for the rest of the rows in the table below.
FieldValue
ActivityDate {!$Record.CreatedDate}
Description {!Description_Template}
OwnerId {!Get_Opportunity_Record.OwnerId}
Status Completed
Subject New SMS
WhatId {!Get_Opportunity_Record.Id}

Subject Field
The Subject Field is the title shown on the Activity Task list on your Opportunity page. You can name the Task anything you want by changing the Value entered in the Subject Field, but it is recommended to use one of the Picklist values: Call, Send Letter, Send Quote, Other, or New SMS.

The TrueDialog integration added New SMS to the Picklist values for Subject. This example uses the New SMS value to match the Log A Call On SMS Flow, which performs this same action for Contact records.

  1. Once you have completed the Field and Value pairs, your Task should look like the following screenshot.
  2. Click the X to close the Decision window.
    Completed Field Values

Save and Activate the Flow

  1. Click Save.
    Click Save
  2. Enter a name for the Flow in the Flow Label textbox.
  3. Click the Flow API Name textbox to auto-populate it with the Flow Label with spaces replaced by underscores.
  4. Click Save.
    Click Save
  5. Click Activate.
    Click Activate

Adding Activity Task List to Opportunity Page

  1. Select the Opportunities tab.
  2. Click your opportunity.
    Click Opportunity Record
  3. Click the Settings Gear icon to open the settings menu.
  4. Click Edit Page.
    Click Edit Page
  5. Drag and drop the Activities component to a location on the page where you want it to appear.
  6. Click Save.
  7. Click the Back arrow to go back to your opportunity.
    Drag and Drop Activities
  8. The following screenshot shows two tasks in the Activity list created by the Incoming Opportunity SMS Log a Call Flow in the instructions above.
    New SMS Tasks
Updated on January 18, 2025
Was this article helpful?
Need Support?
Can’t find the answer you’re looking for? Don’t worry we’re here to help!
CONTACT SUPPORT

Leave a Comment