---
schema_version: "1"
id: e5cb7f6070d4d236d30c00aad1aacbae1ae01334661302735ca0a48b05f23935
title: Route Inbound Calls to the Last Representative
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/service/264-0-0/afcc_sv_calls_to_the_last_rep.md
canonical_url: https://help.salesforce.com/s/articleView?id=service.afcc_sv_calls_to_the_last_rep.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 37d630ca40856f437768cb90022255e7b7caa38e22dc6a09e317255915af0c5d
description: Maximize customer service continuity by automatically connecting callers with the specific human representative who most recently handled their case.
products:
  - Service Cloud
  - Digital Engagement
release: "264"
---
# Route Inbound Calls to the Last Representative

Maximize customer service continuity by automatically connecting callers with the specific human representative who most recently handled their case.

### Required Editions

This article applies to:

Salesforce Voice (Native Telephony)

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Agentforce Contact Center with Salesforce Voice</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Enterprise</strong>, <strong>Unlimited</strong>, and <strong>Developer</strong> Editions</td></tr></tbody></table>

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:center;vertical-align:top;" id="d50438e78">User Permissions Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d50438e78 ">To manage media:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d50438e78 ">
              <p>Agentforce Contact Center Admin (Salesforce Voice) permission set. </p>
              <p style="margin-bottom:0;">Learn how to view <a href="https://help.salesforce.com/s/articleView?id=platform.perm_sets_summary_page.htm&amp;language=en_US" target="_blank">permissions in this permission set</a>.</p>
            </td>

          </tr>
        </tbody>
      </table>

Consider a high-priority support scenario where a customer interacts with a specialist on a complex technical resolution over several days. If they call back for an update, the system identifies that previous representative, verifies their online status, and routes the call directly to them to maintain the conversation thread.

Procedure for Configuring Last Rep Routing

1. From Setup, in the Quick Find box, enter Flows, and then select **Flows**.
2. Click the Omni-channel flow you want to modify. To create a new omni-channel flow, follow these [steps](https://help.salesforce.com/s/articleView?id=service.omnichannel_create_a_flow.htm&type=5&language=en_US).
3. Add a Play Prompt element to deliver a welcome message and configure these settings:
    
    - Label: Welcome
    - API Name: Welcome
    - Amount of Time: 1
    - Units: Days
    - Record ID: {!recordId}
    - Prompt Type: Message
    - Language: English (United States)
    - Voice Profile: Jennifer
    - Message: Welcome!
    
    If the audio plays, the flow follows the Completed path to retrieve call data. If the audio fails to play within the set limit, the Timed Out path serves as an error-handling route to ensure the caller proceeds through the flow.
4. Add a Get Records element to identify the active voice call data and configure these settings:
    
    - Label: Get current voice call
    - API Name: Get\_current\_voice\_call
    - Data Source: Salesforce Object
    - Object: Voice Call
    - Filter Voice Call Records Requirements: All Conditions Are Met (AND)
    - Field: Voice Call ID, Operator: Equals, Value: recordId
    - How many records to store: Only the first record
    - How to store record data: Automatically store all fields
5. Add a Get Records element to fetch the caller's interaction history and configure these settings:
    
    - Label: Get prev voice call
    - API Name: Get\_prev\_voice\_call
    - Data Source: Salesforce Object
    - Object: Voice Call
    - Filter Voice all Records Requirements: All Conditions Are Met (AND)
    - Field: Caller Contact Info, Operator: Equals, Value: Voice call from get current voice call > caller contact info
    - How many records to store: Only the first record
    - How to store record data: Automatically store all fields
    - Sort Voice Call Order: Descending
    - Sort By: CallEndDateTime
6. Add Loop element to iterate the historical call collection and configure these settings:
    
    - Label: Get last voice handled by agent
    - API Name: Get\_last\_voice\_handled\_by\_agent
    - Collection Variable: Voice Calls from Get prev voice call
    - Specify Direction for Iterating Over Collection: First item to last item
7. Add a Decision element within the loop to filter the agents and configure these settings:
    
    - Label: Is Owner an Agent
    - API Name: Is\_Owner\_a\_Agent
    - Select Decision Logic: Define Manually (Default)
    - Outcome Label: Owner is agent
    - Condition Requirements to Execute Outcome: All Conditions Are Met (AND)
    - Resource: Owner ID (User) > User ID, Operator: Starts With, Value: 005
    - Resource: Owner ID (User) > User ID, Operator: Does Not Equal, Value: 005SB00000TbVXBYA3
8. Add an Assignment element to save the agent details to variables and configure these settings:
    
    - Label: Assign LAR
    - API Name: Assign\_LAR
    - Set variable values: Variable: Last\_handled\_agent, Operator: Equals, Value: Owner ID (User) > User ID
    - Variable: LAR\_agent\_name, Operator: Equals, Value: Owner ID (User) > First Name
9. Add a Play Prompt element to inform the caller that their previous representative is found. Configure these settings:
    
    - Label: LAR found in loop
    - API Name: LAR\_found\_in\_loop
    - Amount of time: 1 Day
    - Record ID: {!recordId}
    - Prompt Type: Message
    - Language: English (United States)
    - Voice Profile: Jennifer
    - Message: Great !! I have found the last agent who handled your call. His name is Agent {!LAR\_agent\_name}
10. Add a Decision element to verify if a representative is identified and configure these settings:
    
    - Label: Do we have a Last handled agent?
    - API Name: Do\_we\_have\_Last\_handled\_agent
    - Select decision logic: Default Manual
    - Outcome Label: LAR found
    - Outcome API: LAR\_found
    - Condition: All conditions are met (And)
    - Resource: Last\_handeled\_agent
    - Default Outcome Label: Default Outcome (No agent identified)
    
    The flow branches into two paths. If an agent is found, the system checks for online availability otherwise the flow routes the caller to the general queue.
11. Save and Activate the flow.