Using Salesforce Triggers

This article covers detailed Salesforce usage information.  We recommend you start by following the instructions in this article before proceeding. 

Creating a Record Sync Trigger

This section will cover the basic record sync trigger setup for your Salesforce integration.  To learn more about triggers and all of the options that can be used, see the full article here.

When you have finished creating the trigger, you can use Test Mapping to test the trigger you have created against one of the activities in your CTM account. 

  1. Navigate to Flows → Triggers.  If you do not already have a trigger in your account, you will be redirected to a setup page.  Otherwise, click New Trigger in the upper right.
  2. Enter a name and optional description for the trigger.
  3. Use the drop-down menu to select when this trigger should run.  For Salesforce, we recommend running the trigger at the end of the call to ensure all data is collected before it is sent to Salesforce.
  4. Use the toggle to enable this trigger for all activities in your account, or choose to select specific tracking numbers to use with this trigger.
  5. Click Save Changes.
  6. Click + Add Workflow.
  7. Use the “If all the following rules match” section to set rules for your trigger, such as first-time callers only, or calls over a specific duration.
  8. Click Add Action and select Salesforce Record Sync.
  9. If you are using the legacy Salesforce integration (the “Enable Legacy Salesforce Integration” toggle is on in your Salesforce settings), the trigger will sync using the rules defined in your Salesforce settings.
    • Using this version will complete the trigger setup.  Next, select Save Changes.
  10. For the updated version of the Salesforce integration, check the Custom mapping box to configure your record sync.
  11. Use the drop-down menu to select how you want the information to be sent to Salesforce:
    • Update only will update an existing record.  New records will not be created.
    • Insert only will only create a new record.  No existing records will be updated.
    • Update or insert (upsert) will either create a new record or update an existing record.
  12. Use the Salesforce Object Mapping drop-down menu to select the type of object you would like to sync data to in Salesforce.
    • Advanced users may wish to configure an Advanced Custom SOSL Query instead.  For more information, see “Creating an Advanced Custom SOSL Query” below.
  13. If you wish to associate the Salesforce object you selected to the call or text in your CTM account, check “Associate to Call, Text, Form, etc…”
  14. If you wish to set an owner for the record (based on your Salesforce integration settings), check “Set record owner.”
  15. Select Add Field Mapping to begin creating your custom mappings.
  16. In the row that is added, select the following details:
    • The CTM field with data you wish to send to Salesforce
    • The Salesforce field where the data should appear
    • The default value to use if a value is not available (optional)
      • Click the edit button next to this field to see shortcut tokens that can be used here
    • Whether the record sync should always or never overwrite the selected Salesforce field
  17. Click Add Field Mapping to continue adding fields as needed.
  18. Save Changes. Once your CTM account has been linked to Salesforce, you can use triggers to customize record syncing and campaign associations between your accounts.  Using triggers with your Salesforce integration will allow you to:
    • Set specific conditions for when data should be sent to Salesforce
    • Select which object types should be updated
    • Create custom field mappings to determine where data will be inserted or updated in your Salesforce account
    • Automatically execute other actions, such as applying tags or sending notifications, alongside the record sync
  19.  

Creating a Salesforce Campaign Trigger

This section will cover the basic campaign link trigger setup for your Salesforce integration.  To learn more about triggers and all of the options that can be used, see the full article here.

    1. Navigate to Flows → Triggers.  If you do not already have a trigger in your account, you will be redirected to a setup page, otherwise, click New Trigger in the upper right.
    2. Enter a name and optional description for the trigger.
    3. Use the drop-down menu to select when this trigger should run.  For Salesforce, we recommend running the trigger at the end of the call to ensure all data is collected before it is sent to Salesforce.
    4. Use the toggle to enable this trigger for all activities in your account, or choose to select specific tracking numbers to use with this trigger.
    5. Save Changes.
    6. Select + Add Workflow.
    7. Use the “If all the following rules match” section to set rules for your trigger, such as first-time callers only, or calls over a specific duration.
    8. Click Add Action and select Salesforce Campaign.
    9. By default, the Salesforce campaign selected will be based on the Tracking Source associated with the activity.  To use a specific campaign instead, check the box labeled “Link to specific Campaign.”
    10. Use the drop-down menu to select the campaign to link to the activity.
    11. Save Changes.
    12. For the updated version of the Salesforce integration, check the Custom mapping box to configure your record sync.
    13. Use the drop-down menu to select how you want the information to be sent to Salesforce:
      • Update only will update an existing record.  New records will not be created.
      • Insert only will only create a new record.  No existing records will be updated.
      • Update or insert (upsert) will either create a new record or update an existing record.
    14. Use the Salesforce Object Mapping drop-down menu to select the type of object you would like to sync data to in Salesforce.
      • Advanced users may wish to configure an Advanced Custom SOSL Query instead.  For more information, see “Creating an Advanced Custom SOSL Query” below.
    15. If you wish to associate the Salesforce object you selected to the call or text in your CTM account, check “Associate to Call, Text, Form, etc…”
    16. If you wish to set an owner for the record (based on your Salesforce integration settings), check “Set record owner.”
    17. Select Add Field Mapping to begin creating your custom mappings.
    18. In the row that is added, select the following details:
      • The CTM field with data you wish to send to Salesforce
      • The Salesforce field where the data should appear
      • The default value to use if a value is not available (optional)
        • Click the edit button next to this field to see shortcut tokens that can be used here
      • Whether the record sync should always or never overwrite the selected Salesforce field
    19. Click Add Field Mapping to continue adding fields as needed.
    20. Save Changes. Once your CTM account has been linked to Salesforce, you can use triggers to customize record syncing and campaign associations between your accounts.  Using triggers with your Salesforce integration will allow you to:
      • Set specific conditions for when data should be sent to Salesforce
      • Select which object types should be updated
      • Create custom field mappings to determine where data will be inserted or updated in your Salesforce account
      • Automatically execute other actions, such as applying tags or sending notifications, alongside the record sync

Creating an Advanced Custom SOSL Query

This setting is available when configuring a Salesforce record sync.  Configuring your own query allows you to specify your own rules for matching records between CTM and Salesforce.

Note: this setting requires advanced knowledge of SOSL query language.  Do not use this feature unless you are familiar with its usage.

    1. While configuring a Salesforce record sync (see instructions above), click the pencil icon next to the Salesforce Object Mapping field to open the Advanced Custom SOSL Query window.Screenshot_2023-04-11_at_2.18.49_PM.png
    2. Click Add Query and enter your custom query.  You can provide up to 3 queries. For example:
      1. FIND {555*555*5555 OR 1*555*555*5555 OR 555.*555.*5555} IN PHONE FIELDS RETURNING Account LIMIT 1
      2. FIND {who@example.com} IN EMAIL FIELDS RETURNING Account LIMIT 1
    3. Select Add Query to add up to three total queries.
    4. Use the drop-down to select a call from your account and click Test Query to confirm whether your query will work as intended.
    5. Click Stage.
Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Article is closed for comments.