Docs/History & record linking/Log Chat Conversations to Activity History

Log Chat Conversations to Activity History

A flow can convert a complete chat conversation into activity history. Each time a chat conversation starts, a chat session record is created with its status field set to "open."

Last updated 28 Nov 2025

How a chat session's status changes

When the conversation is closed from the chat console, the chat session record's status field updates to "closed."

There are multiple ways to close a chat session:

  1. The user closes it manually.
  2. It closes automatically when a new message arrives and the gap since the last message is longer than the session time set on the ValueText Setup page (Step 1).
  3. A scheduled job closes it after a set time if the customer never replies.

Build the flow to log the conversation

Set up a flow that runs when a chat session closes, then walks its related messages into a single activity history entry.

  1. Set the start conditions. Trigger the flow when a Chat Session record is updated, with an entry condition of rsplus__Status__c Equals Closed.
    Salesforce Flow Configure Start screen for the Chat Session object, with A record is updated selected as the trigger and the entry condition rsplus__Status__c Equals Closed highlighted in a pink box.
    Fig 01
  2. Get the Message Bucket records. Retrieve Message Bucket records where rsplus__Chat_Session__c (the lookup field on Message Bucket) equals the chat session record's Record ID.
    Salesforce Flow Edit Get Records screen named Get messages, retrieving Message Bucket records where rsplus__Chat_Session__c equals the record's Record ID, sorted by LastModifiedDate descending, storing all records with all fields.
    Fig 02
  3. Create a text variable. Add a Text variable to hold the full conversation as it gets assembled.
    Salesforce Flow Edit Variable dialog with Data Type set to Text and both Available for input and Available for output checked.
    Fig 03
  4. Loop through the messages and build the log. Loop over the Message Bucket records and append each one to the variable using a formula field:

    ```

    IF(ISBLANK({!Description}), '', {!Description}+BR())

    +TEXT({!Get_messages_into_variable.rsplus__Type__c})

    +' --['+TEXT({!Get_messages_into_variable.rsplus__Submitted_On__c})+'] --'+

    {!Get_messages_into_variable.rsplus__Message__c}

    ```

    Salesforce Flow Edit Formula dialog for the Task_Description resource, showing a Text formula that appends each looped message's rsplus__Type__c, rsplus__Submitted_On__c, and rsplus__Message__c fields onto the running Description.
    Fig 04
  5. Create the Task. Add a Create Records element for the Task object to log the conversation under the activity history of the related record.
    Salesforce Flow Edit Create Records screen for the Task object, with ActivityDate set to the current loop item, Description set to the Description resource, OwnerId set to $User.Id, Priority set to Normal, Status set to In Progress, Subject set to TaskDescription, and WhoId set to $Record > Related id.
    Fig 05

The complete flow:

Salesforce Flow Builder canvas showing the complete record-triggered flow, with a Get messages Get Records element feeding a loop that runs an Add to Description assignment for each item before a Task Create Records element and the End node.
Fig 06
Was this helpful?
← PreviousConfigure Message-to-Activity Logging Next →Transfer Old Messages Between Records
Docs/History & record linking/Log Chat Conversations to Activity History

Log Chat Conversations to Activity History

A flow can convert a complete chat conversation into activity history. Each time a chat conversation starts, a chat session record is created with its status field set to "open."

Last updated 28 Nov 2025

How a chat session's status changes

When the conversation is closed from the chat console, the chat session record's status field updates to "closed."

There are multiple ways to close a chat session:

  1. The user closes it manually.
  2. It closes automatically when a new message arrives and the gap since the last message is longer than the session time set on the ValueText Setup page (Step 1).
  3. A scheduled job closes it after a set time if the customer never replies.

Build the flow to log the conversation

Set up a flow that runs when a chat session closes, then walks its related messages into a single activity history entry.

  1. Set the start conditions. Trigger the flow when a Chat Session record is updated, with an entry condition of rsplus__Status__c Equals Closed.
    Salesforce Flow Configure Start screen for the Chat Session object, with A record is updated selected as the trigger and the entry condition rsplus__Status__c Equals Closed highlighted in a pink box.
    Fig 01
  2. Get the Message Bucket records. Retrieve Message Bucket records where rsplus__Chat_Session__c (the lookup field on Message Bucket) equals the chat session record's Record ID.
    Salesforce Flow Edit Get Records screen named Get messages, retrieving Message Bucket records where rsplus__Chat_Session__c equals the record's Record ID, sorted by LastModifiedDate descending, storing all records with all fields.
    Fig 02
  3. Create a text variable. Add a Text variable to hold the full conversation as it gets assembled.
    Salesforce Flow Edit Variable dialog with Data Type set to Text and both Available for input and Available for output checked.
    Fig 03
  4. Loop through the messages and build the log. Loop over the Message Bucket records and append each one to the variable using a formula field:

    ```

    IF(ISBLANK({!Description}), '', {!Description}+BR())

    +TEXT({!Get_messages_into_variable.rsplus__Type__c})

    +' --['+TEXT({!Get_messages_into_variable.rsplus__Submitted_On__c})+'] --'+

    {!Get_messages_into_variable.rsplus__Message__c}

    ```

    Salesforce Flow Edit Formula dialog for the Task_Description resource, showing a Text formula that appends each looped message's rsplus__Type__c, rsplus__Submitted_On__c, and rsplus__Message__c fields onto the running Description.
    Fig 04
  5. Create the Task. Add a Create Records element for the Task object to log the conversation under the activity history of the related record.
    Salesforce Flow Edit Create Records screen for the Task object, with ActivityDate set to the current loop item, Description set to the Description resource, OwnerId set to $User.Id, Priority set to Normal, Status set to In Progress, Subject set to TaskDescription, and WhoId set to $Record > Related id.
    Fig 05

The complete flow:

Salesforce Flow Builder canvas showing the complete record-triggered flow, with a Get messages Get Records element feeding a loop that runs an Add to Description assignment for each item before a Task Create Records element and the End node.
Fig 06
Was this helpful?
← PreviousConfigure Message-to-Activity Logging Next →Transfer Old Messages Between Records
Docs/History & record linking/Log Chat Conversations to Activity History

Log Chat Conversations to Activity History

A flow can convert a complete chat conversation into activity history. Each time a chat conversation starts, a chat session record is created with its status field set to "open."

Last updated 28 Nov 2025

How a chat session's status changes

When the conversation is closed from the chat console, the chat session record's status field updates to "closed."

There are multiple ways to close a chat session:

  1. The user closes it manually.
  2. It closes automatically when a new message arrives and the gap since the last message is longer than the session time set on the ValueText Setup page (Step 1).
  3. A scheduled job closes it after a set time if the customer never replies.

Build the flow to log the conversation

Set up a flow that runs when a chat session closes, then walks its related messages into a single activity history entry.

  1. Set the start conditions. Trigger the flow when a Chat Session record is updated, with an entry condition of rsplus__Status__c Equals Closed.
    Salesforce Flow Configure Start screen for the Chat Session object, with A record is updated selected as the trigger and the entry condition rsplus__Status__c Equals Closed highlighted in a pink box.
    Fig 01
  2. Get the Message Bucket records. Retrieve Message Bucket records where rsplus__Chat_Session__c (the lookup field on Message Bucket) equals the chat session record's Record ID.
    Salesforce Flow Edit Get Records screen named Get messages, retrieving Message Bucket records where rsplus__Chat_Session__c equals the record's Record ID, sorted by LastModifiedDate descending, storing all records with all fields.
    Fig 02
  3. Create a text variable. Add a Text variable to hold the full conversation as it gets assembled.
    Salesforce Flow Edit Variable dialog with Data Type set to Text and both Available for input and Available for output checked.
    Fig 03
  4. Loop through the messages and build the log. Loop over the Message Bucket records and append each one to the variable using a formula field:

    ```

    IF(ISBLANK({!Description}), '', {!Description}+BR())

    +TEXT({!Get_messages_into_variable.rsplus__Type__c})

    +' --['+TEXT({!Get_messages_into_variable.rsplus__Submitted_On__c})+'] --'+

    {!Get_messages_into_variable.rsplus__Message__c}

    ```

    Salesforce Flow Edit Formula dialog for the Task_Description resource, showing a Text formula that appends each looped message's rsplus__Type__c, rsplus__Submitted_On__c, and rsplus__Message__c fields onto the running Description.
    Fig 04
  5. Create the Task. Add a Create Records element for the Task object to log the conversation under the activity history of the related record.
    Salesforce Flow Edit Create Records screen for the Task object, with ActivityDate set to the current loop item, Description set to the Description resource, OwnerId set to $User.Id, Priority set to Normal, Status set to In Progress, Subject set to TaskDescription, and WhoId set to $Record > Related id.
    Fig 05

The complete flow:

Salesforce Flow Builder canvas showing the complete record-triggered flow, with a Get messages Get Records element feeding a loop that runs an Add to Description assignment for each item before a Task Create Records element and the End node.
Fig 06
Was this helpful?
← PreviousConfigure Message-to-Activity Logging Next →Transfer Old Messages Between Records
Docs/History & record linking/Log Chat Conversations to Activity History

Log Chat Conversations to Activity History

A flow can convert a complete chat conversation into activity history. Each time a chat conversation starts, a chat session record is created with its status field set to "open."

Last updated 28 Nov 2025

How a chat session's status changes

When the conversation is closed from the chat console, the chat session record's status field updates to "closed."

There are multiple ways to close a chat session:

  1. The user closes it manually.
  2. It closes automatically when a new message arrives and the gap since the last message is longer than the session time set on the ValueText Setup page (Step 1).
  3. A scheduled job closes it after a set time if the customer never replies.

Build the flow to log the conversation

Set up a flow that runs when a chat session closes, then walks its related messages into a single activity history entry.

  1. Set the start conditions. Trigger the flow when a Chat Session record is updated, with an entry condition of rsplus__Status__c Equals Closed.
    Salesforce Flow Configure Start screen for the Chat Session object, with A record is updated selected as the trigger and the entry condition rsplus__Status__c Equals Closed highlighted in a pink box.
    Fig 01
  2. Get the Message Bucket records. Retrieve Message Bucket records where rsplus__Chat_Session__c (the lookup field on Message Bucket) equals the chat session record's Record ID.
    Salesforce Flow Edit Get Records screen named Get messages, retrieving Message Bucket records where rsplus__Chat_Session__c equals the record's Record ID, sorted by LastModifiedDate descending, storing all records with all fields.
    Fig 02
  3. Create a text variable. Add a Text variable to hold the full conversation as it gets assembled.
    Salesforce Flow Edit Variable dialog with Data Type set to Text and both Available for input and Available for output checked.
    Fig 03
  4. Loop through the messages and build the log. Loop over the Message Bucket records and append each one to the variable using a formula field:

    ```

    IF(ISBLANK({!Description}), '', {!Description}+BR())

    +TEXT({!Get_messages_into_variable.rsplus__Type__c})

    +' --['+TEXT({!Get_messages_into_variable.rsplus__Submitted_On__c})+'] --'+

    {!Get_messages_into_variable.rsplus__Message__c}

    ```

    Salesforce Flow Edit Formula dialog for the Task_Description resource, showing a Text formula that appends each looped message's rsplus__Type__c, rsplus__Submitted_On__c, and rsplus__Message__c fields onto the running Description.
    Fig 04
  5. Create the Task. Add a Create Records element for the Task object to log the conversation under the activity history of the related record.
    Salesforce Flow Edit Create Records screen for the Task object, with ActivityDate set to the current loop item, Description set to the Description resource, OwnerId set to $User.Id, Priority set to Normal, Status set to In Progress, Subject set to TaskDescription, and WhoId set to $Record > Related id.
    Fig 05

The complete flow:

Salesforce Flow Builder canvas showing the complete record-triggered flow, with a Get messages Get Records element feeding a loop that runs an Add to Description assignment for each item before a Task Create Records element and the End node.
Fig 06
Was this helpful?
← PreviousConfigure Message-to-Activity Logging Next →Transfer Old Messages Between Records