How to configure direct record owner routing

Prev Next

This guide is intended for advanced Salesforce admins. For Salesforce education, contact Salesforce directly or use trailheads for specific knowledge.

Direct Record Owner Routing allows you to dynamically route an inbound call to the specific Salesforce user who "owns" the caller's record (such as a Lead, Account, or Case). By leveraging Natterbox's ability to query Salesforce data in real-time, the routing policy identifies the owner ID associated with the incoming phone number and attempts to connect the caller directly to that individual, bypassing generic queues or IVRs. Although this guide is configured for Account Owners, this setup will work for other Salesforce Object records such as Leads, Opportunity, Case, etc.

Use Cases:

  • VIP/Account Management: Ensure high-value clients are always connected to their dedicated Account Manager to maintain a personalized relationship.

  • Sales Continuity: Route a returning prospect directly to the Lead Owner who is already familiar with their requirements and history.

  • Case Ownership: Direct a customer calling about an active support ticket straight to the technician currently assigned to the Case, reducing the need for transfers and repeated information.

The Build:

Scenario: If a customer calls from a number that is directly associated to an “Account” and that account has a dedicated “Account Owner” the call will first route directly to the assigned account owner after an availability check to make sure they are marked as “Available”. If no answer the call will overflow to the Sales Call queue.

Overview:

Step 1: Configure a “Query Object” component to check the callers number against any existing Account.

  • Provide the component a name “Query Account Owner”

  • Update “Result Set” Field to “AccountOwnerResults”

  • Trigger When: “Records Found”

  • Record Type = Account

  • Filter Results: Add all Phone Fields currently in use for this object. For this instance it was just “Phone” and add both $(E164CallerNumber) and $(CallerNumber) as this will ensure whatever format the number are in it is picked up correctly.

  • Selected Fields = “OwnerID”

Step 2: Configure an additional “Query Object” component as this time we will use the results we gathered from the previous query "(OwnerID) to search for the related Natterbox user to provide us with the agents username and SIP extension for direct calling.

  • Provide the component a name “Query Natterbox User”

  • Update “Results Set” field to “QueryNBUser”

  • Trigger When: “Records Found”

  • Report Type = nbavs_User_c

  • Filter Results: Add the field “nbavs_user_c” = $(SForce_AccountOwnerResults.OwnerId) This is the result set we gather in the previous query component. You can populate this macro by clicking the Phone Icon with an Arrow pointing to the right and under “Salesforce Results” you will find your result set. Press the blue “Add” button to populate this field.

  • Selected Fields: “nbavs_SipExtension_c” AND “nbavs_Username_c”

Step 3: (OPTIONAL) To add an availability query to understands agents availability prior to pushing a call to them directly you will need to configure a “Lua Script Engine” component. This will query the Natterbox User and provide a macro to use - $(Custom_AvailabilityState) that will capture the current status the agent is in. If you did not label your result set for QueryNBUser the same as above you may need to update this script to reflect the Macro name for nbavs_username_c capture.

  • Provide the component a name “Availability Query”

  • Add the following Script:

    -- DO NOT DELETE THE FOLLOWING COMMENTS - FORCE FSX8
    -- Fsx8
    
    enable_debug('email')
    -- Get the ID directly from the session variable
    local username = session.expand_macro('$(SForce_QueryNBUser.nbavs__Username__c)')
    
    local soql = "SELECT nbavs__Id__c FROM nbavs__User__c WHERE nbavs__Username__c = '"..username.."' LIMIT 1"
    
    local sfRes = connector.sf_query(connectorId, soql , "User")
    
    local recordCount = 0
    
    if sfRes ~= false then
    	recordCount = table.getn(sfRes)
    end
    
    if recordCount > 0 then
    	-- There will only ever be 1 result returned
    	local state = session.get_availability_state(tonumber(sfRes[1]['nbavs__Id__c']))
    	
    	-- Macro created $(Custom_AvailabilityState)
    	session.set('AvailabilityState', state)
    	return true
    
    else
    	-- No results
    	return false
    end

Step 4: (OPTIONAL) You will now need to configure a “Rule” component to use the above capture of availability to determine routing. IE if the agent is marked as “Available” the call will try to connect. If they are on a status that is not available the call will just overflow to a Call queue.

    • Provide the component a name “Available?”

    • Select “Evaluate”

    • Property: $(Custom_AvailabilityState) - This is the macro we captured in the LUA script above.

    • Operator: Equals

    • Value: “Available” - Please note you may need to update the “Value” field to correctly represent the availability state you are currently using to determine when an agent is available/ready for calls.

Step 5: Configure the “Connect a Call Component” to handle the direct routing of the call to the desired agent. You will utilize the macro we captured in the Natterbox User Query to populate the “$(SForce_QueryNBUser.nbavs__SipExtension__c)” information.

  • Provide the component a name “Connect a Call - Account Owner”

  • Trigger when: Call is connected, Call is not connected, Camp Exit.

  • Under the “Connect Tab” Select “Phone Number” under Action and in the Number field you will populate the Macro for the agents SIP Extension “$(SForce_QueryNBUser.nbavs__SipExtension__c)”

  • Under the “Advanced” tab you can configure how long you want to dial out before overflowing - by default it will be 30 seconds.

Step 6: Configure a “Call Queue” component to act as an overflow to handle calls that return no account owner and also to handle calls if the account owner is set to an offline availability status.

Step 7: (OPTIONAL) We would advise configuring a reporting gate to mark calls that had no match to the account query / Natterbox user query. This means that the callers number did not match any known account record or the account had no assigned Owner ID. For more information related to Reporting gates please see our guide Reporting Gates