---
schema_version: "1"
id: 1a945257ecef61463ccaac21ea85ef6463e4d5cee96ae2c22ce0a59cbaacfba0
title: Update Messaging Session with Employee Details
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/service/264-0-0/es_update_messaging_session_with_contact_details.md
canonical_url: https://help.salesforce.com/s/articleView?id=service.es_update_messaging_session_with_contact_details.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 50701ed2421f7cef32d1a64c6e757e1d189be63e7225e939a92b7078a61caba2
description: When an employee contacts a service representative through chat, the service representative receives an incoming chat notification in HR Service Console. To show the name of the employee in the notification, the messaging session record must contain the employee's account ID, contact ID, and full name. To update the messaging session record with these details, create an autolaunched flow and update the Omni-Channel flow.
products:
  - Service Cloud
release: "264"
---
# Update Messaging Session with Employee Details

When an employee contacts a service representative through chat, the service representative receives an incoming chat notification in HR Service Console. To show the name of the employee in the notification, the messaging session record must contain the employee's account ID, contact ID, and full name. To update the messaging session record with these details, create an autolaunched flow and update the Omni-Channel flow.

### Required Editions

<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;"><a href="https://help.salesforce.com/s/articleView?id=service.service_editions_reference.htm&amp;language=en_US" target="_blank">View supported editions</a>.</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="d99874e55">User Permissions
              Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d99874e55 ">To open, edit, or create a flow in Flow Builder:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d99874e55 ">Manage Flow</td>

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

## Create Autolaunched Flow to Update Messaging Session Record

1. From Setup, in the Quick Find box, enter Flows, and select **Flows**.
2. Create a **New Flow**.
3. Select **Start From Scratch**, and click **Next**.
4. Select **Autolaunched Flow (No Trigger)**, and click **Create**.
5. From the **Manager** tab in Toolbox, create these input variables: userId and routableId.
    
    The userId variable stores the user ID passed into the flow. The routableId stores the routable ID of messaging session record of the current messaging session.
6. Add these Get Record elements to the flow: Get User, Get Contact, and Get Messaging Session.
7. Add an Update Records element called Update Messaging Session.
8. In the Get User element, use the user ID passed into the flow to get the employee's user record.
    1. In the Data Source section, select **Salesforce Object**.
    2. From the Object dropdown list, select **User**.
    3. From the Condition Requirements dropdown list, select **All Conditions Are Met (AND)**.
    4. Add a condition to get a user record if the user ID is equal to the value stored in the userId variable.
    5. In the How Many Records to Store section, select **Only the first record.**
    6. In the How to Store Record Data section, select **Automatically store all fields**.
9. In the Get Contact element, use the user record received from the Get User element to get the related contact record.
    1. In the Data Source section, select **Salesforce Object**.
    2. Select **Contact** in the Object dropdown list.
    3. Select **All Conditions Are Met (AND)** in the Condition Requirements dropdown list.
    4. Add a condition to get the related contact record if the contact ID is equal to the related contact ID of the user record stored in the User from Get User record variable.
    5. In the How Many Records to Store section, select **Only the first record.**
    6. In the How to Store Record Data section, select **Automatically store all fields**.
10. In the Get Messaging Session element, use the routableID passed into the flow to get the current messaging session record.
    1. In the Data Source section, select **Salesforce Object**.
    2. From the Object dropdown list, select **Messaging Session**.
    3. From the Condition Requirements dropdown list, select **All Conditions Are Met (AND)**.
    4. Add a condition to get a messaging session record if its ID is equal to the value stored in the routableId variable.
    5. In the How Many Records to Store section, select **Only the first record.**
    6. In the How to Store Record Data section, select **Automatically store all fields**.
11. In the Update Messaging Session element, update the current messaging session record with the related contact record's contact ID, full name, and related account ID.
    1. In the How to Find Records to Update and Set Their Values section, select **Specify conditions to identify records, and set fields individually**.
    2. From the Object dropdown list, select **Messaging User**.
    3. From the Condition Requirements to Update Records dropdown list, select **All Conditions Are Met (AND)**.
    4. Add a condition to get the messaging user record if its ID is equal to the related messaging user ID of the record stored in the Messaging Session from Get Messaging Session record variable.
    5. In the Set Field Values for the Messaging User Records section, set the AccountId field value to the ID of the account related to the record stored in the Contact from Get Contact record variable. Set the ContactId field value to the value stored in the Contact ID field of the Contact from Get Contact record variable. Set the Name field value to the value stored in the Full Name field of the Contact from Get Contact record variable.
12. Activate the flow.

## Update Omni-Channel Flow for Embedded Messaging

Return to the Omni-Channel flow that you created when you prepared a Salesforce org, and add the autolaunched flow as a subflow.

1. From Setup, in the Quick Find box, enter **Flows**, and select **Flows**.
2. From the list, find and select your previous Omni-Channel flow.
3. Add a Subflow element after Start, and select the autolaunched flow that you previously created.
4. Specify the label, API name, and description.
5. Set input values for the autolaunched flow by passing the userID and recordID variable values from the Omni-Channel flow.
6. Activate the flow.
    
    With this flow, a service representative sees the employee's account ID, contact ID, and full name in the messaging session record. The incoming chat notification shows the employee's name.