You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在Twilio Studio中获取号码友好名称以完善Salesforce线索Campaign信息?

Solution to Capture IVR Number Friendly Name/Activity Info in Salesforce Leads

Great question—this is a common scenario when linking telephony data to CRM systems. Here are three reliable approaches to get the friendly name (and associated activity info) for your called IVR number and attach it to your Salesforce lead:

1. Use a Local Lookup Table in Your IVR Platform

Most IVR systems let you store key-value pairs or a lookup table that maps phone numbers to their friendly names/activity details. Here's how to implement this:

  • Create a table where each entry includes:
    • Called Number (matches the format of {{trigger.call.To}})
    • Friendly Name (e.g., "Metro Campaign - New York")
    • Activity Type (e.g., "Metro")
    • City
  • In your IVR workflow, when a call comes in, use the {{trigger.call.To}} value to query this table. Retrieve the corresponding friendly name and activity fields.
  • Pass these values along with the caller number when triggering the Salesforce lead creation process.

For example, pseudocode for this logic might look like:

// Sample lookup logic
const ivrNumberMappings = {
  "+1234567890": { friendlyName: "Metro Campaign - Chicago", activity: "Metro", city: "Chicago" },
  "+1987654321": { friendlyName: "Facebook Ad - Miami", activity: "Facebook", city: "Miami" }
};

const calledNumber = "{{trigger.call.To}}";
const numberDetails = ivrNumberMappings[calledNumber];

// Pass numberDetails.friendlyName and numberDetails.activity to Salesforce lead creation

2. Fetch Details via Your Telephony Provider's API

If your IVR numbers are managed by a telephony provider, their API likely has endpoints to retrieve number details including the friendly name:

  • In your IVR workflow, after capturing {{trigger.call.To}}, make an API call to your provider's number lookup endpoint using that value.
  • Extract the friendly name (and any embedded activity info) from the API response.
  • Include this data in the payload when creating the Salesforce lead.

Note: Ensure your IVR platform supports outbound API calls, and that you have valid authentication credentials for your provider's API.

3. Store Mapping in Salesforce & Perform a Lookup

To keep all number-to-activity mappings within Salesforce (for easier management), create a custom object and use it to populate lead fields:

  • Step 1: Create a custom object in Salesforce (e.g., IVR_Number__c) with fields:
    • Phone_Number__c (text field formatted to match {{trigger.call.To}})
    • Friendly_Name__c (text field for the activity-inclusive name)
    • Activity_Type__c (picklist or text field for Metro/Bus/Google/etc.)
    • City__c (text or picklist)
  • Step 2: Populate this custom object with all your IVR numbers and their corresponding details.
  • Step 3: When creating the lead:
    • Use Salesforce's API to run a SOQL query on IVR_Number__c to fetch details, then populate the lead's relevant fields.
    • Or, use Salesforce Flow/Process Builder to set up a lookup from the lead's custom called number field to the IVR_Number__c object, auto-populating activity/friendly name fields.

Example SOQL query to retrieve details:

SELECT Friendly_Name__c, Activity_Type__c, City__c FROM IVR_Number__c WHERE Phone_Number__c = '{{trigger.call.To}}'

Key Considerations

  • Number Formatting: Ensure {{trigger.call.To}} matches the format stored in your mapping (e.g., with country code, no spaces) to avoid lookup failures.
  • Error Handling: Add logic to handle missing number entries (e.g., default to "Unknown Activity" or log an error for follow-up).
  • Maintenance: Regularly update mappings when adding new IVR numbers or changing campaign activities to keep data accurate.

内容的提问来源于stack exchange,提问作者user1553825

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.27 04:05:23