SUPPORT.TWILIO.COM END OF LIFE NOTICE: This site, support.twilio.com, is scheduled to go End of Life on February 27, 2024. All Twilio Support content has been migrated to help.twilio.com, where you can continue to find helpful Support articles, API docs, and Twilio blog content, and escalate your issues to our Support team. We encourage you to update your bookmarks and begin using the new site today for all your Twilio Support needs.

How Twilio Flex Determines Customer Contact Display Name

Question

What does Flex use to determine the customer's identity (name/phone/email) for display in the Flex UI and to be used by other product integrations?

 

Product

Twilio Flex

 

Environment

legacy Twilio Console

 

Answer

Flex displays a customer label in the task list, conversation header, and anywhere the customer is identified in the Flex UI. Flex determines that label by evaluating task attributes in a specific priority order and using the first attribute that resolves to a value:
 

  1. name (highest priority, all channels)
    If name is present in the Task's attributes, Flex uses it as-is and skips all other checks. Use this when you want full control over what is displayed (including custom labels like an account number or ticket ID).

    {
      "name": "Jane Smith" 
    }
    
  2. outbound_to (outbound calls only)
    If the task is an outbound call and name is not set, Flex displays outbound_to (the number dialed). This is set automatically by Flex for agent-initiated outbound calls.

    {
      "outbound_to": "+15555551234"
    }
  3. customerName + customerAddress (email tasks only)
    For email tasks, if name is not set, Flex combines these into:

    {customerName} - {customerAddress}

If customerName is absent, only customerAddress is shown.

Attributes set Display
customerName + customerAddress Jane Smith - jane@example.com
customerAddress only jane@example.com
{
  "customerName": "Jane Smith",
  "customerAddress": "jane@example.com"
}
  1. from (default fallback for other channels)
    For tasks that don’t match the conditions above (for example inbound SMS, WhatsApp, web chat, or voice), Flex falls back to from (typically the customer’s inbound contact address). This is usually populated automatically from the inbound request, but can be overridden if needed.

    {
      "from": "+15555559876"
    }

 

Summary Table

Attribute Channel / Condition Notes
name All channels Overrides everything. Set this for full control.
outbound_to Outbound calls only Usually set by Flex automatically.
customerName Email only Optional. Combined with customerAddress.
customerAddress Email only Required for email display.
from All other channels (inbound) Usually set automatically from inbound contact address.

 

Additional Information

Learn more on viewing or setting Task Attributes

Have more questions? Submit a request
Powered by Zendesk