We can convert a complete chat conversation into activity history using a flow. Each time a chat conversation starts, a chat session object record is created with the status field set to “open.”
When the conversation is closed from the chat console, the chat session record’s status field will be updated to “closed.”
Note: There are multiple ways to close a chat session:
1. Manually closing the chat session by the user.
2. Automatically closing the chat session when a new message is received, and the time difference between the new message and the last message is more than the session time defined in the ValueText Setup page (Step 1).
3. Closing the session using scheduled jobs after a certain time if there is no reply from the customer.
Flow for converting chat conversation into Activity History:
1.Start conditions:
2. Get Records of Message Bucket with the following conditions (where chat session is the lookup field at Message bucket object):
3. Create a Text variable to hold the entire conversation:
4. Now, loop through the message bucket records and add the messages to the variable created in the previous step using a formula field. The formula should look like this:
5. Create a Task to log the conversation under the activity history of the respective record:
Complete flow: