Transferring Pre Chat Data to Your Salesforce Agents
237 views
May 15, 2025
We can pass Pre-Chat information to Salesforce Agentforce Agents. In order to do so, update the Messaging Session record with the Pre-Chat information. In the Agentforce Agent, use the Messaging Session Context Variable to refer it. Blog Post: https://www.infallibletechie.com/2025/05/transferring-pre-chat-data-to-salesforce-agentforce-agent.html
View Video Transcript
0:06
hello everyone In this video we are
0:08
going to see how to pass pre-hat
0:13
information from Salesforce messaging
0:15
for
0:17
web to agent force
0:19
agent If you wanted to pass the
0:22
pre-chart
0:24
information to Salesforce agent force
0:27
agent and if you are using messaging for
0:30
inapp and web then you can refer this
0:32
video as a reference The first step is
0:36
create a field in messaging session
0:40
object We are going to make use of this
0:43
field as context variable in the agent
0:47
force agent so that we will be able to
0:50
pass the information from the
0:52
pre-chart to agent force agent So here I
0:57
have created a field called request type
1:00
It is a picklist field
1:05
Next in the omni channel flow which
1:08
routes the messaging session to the
1:11
agent force agent I am making use of
1:14
update records flow element In the
1:16
update records flow element I'm updating
1:19
the messaging
1:22
session the request type field on the
1:25
messaging session with this variable
1:27
request type This request type is an
1:31
input variable in my
1:35
flow In the messaging channel I created
1:38
a custom
1:40
parameter data type
1:43
string and I have done the parameter
1:47
mappings for this request type which is
1:51
a custom parameter The flow variable
1:53
value is request type So whenever the
1:57
messaging session is invoked it will
2:00
pass the value of request type the user
2:05
has selected to this request type flow
2:09
variable So it is updating the messaging
2:12
session with the request type that was
2:14
passed from the messaging
2:17
um pre-chart
2:20
Next in the embedded service deployment
2:23
I added this
2:25
uh
2:28
prehat So you have to click save and
2:31
then you have to publish it Whenever we
2:33
do any changes in the messaging channel
2:36
and as well as in the embedded service
2:38
deployment we have to click publish So I
2:41
have published it already Let's test it
2:44
out
2:47
So here I created a topic called
2:54
service This will get
2:58
invoked only if the filter value
3:03
is service Let's see how I have done
3:06
that
3:08
First in the context
3:10
variable we have to add
3:15
the request type field So you can add it
3:18
by deactivating the agent force agent Go
3:23
to context select messaging session
3:26
click edit included fields and then you
3:29
will be able to add additional fields So
3:32
I have selected request type field
3:38
Next in the same context if you go to
3:41
filters you will be able to create a new
3:44
filter So you can click new So here I'm
3:47
going to select uh create
3:49
sales I'm going to select
3:52
uh the messaging session request
3:56
type equals
3:58
to sales So similarly I have created for
4:02
service also
4:05
If the request type is service then this
4:08
filter will be
4:09
true and this topic will fire only when
4:14
the request type is service If it is
4:17
different like sales or marketing then
4:19
this particular topic won't get
4:25
triggered So this topic is for handling
4:28
the user inquiries which are related to
4:31
service management Let's test it out So
4:34
this is my messaging for inapp and
4:37
web I'm going to say admin
4:41
user admin at
4:44
demo.com Here I'm going to select
4:47
service
4:48
Once I click service since this filter
4:51
is
4:52
satisfied if I ask any question related
4:55
to service then it should
4:59
um invoke this topic and then it should
5:02
get the repair number or it can get my
5:05
email Let's see whether it is invoking
5:07
that So I have selected service
5:17
Okay I forgot to activate the agent
5:20
force agent Now I activated it Now let's
5:23
uh test it
5:30
again So here I'm selecting
5:36
service My agent force agent is invoked
5:40
Now I'm going to
5:44
say car service
5:52
issue So it is asking me to provide the
5:55
repair number or the email address So
5:57
definitely this uh in uh topic was
6:01
invoked and then it was able to process
6:03
it
6:05
Now let me end
6:07
this and let me make a note of this
6:13
one Now I'm going to initiate one more
6:16
messaging
6:21
session and then I'm going to select
6:24
sales Before that you can also verify
6:29
that it is
6:32
uh service So it updated the messaging
6:35
session and the agent force agent was
6:37
able to use it Now I'm selecting
6:43
sales So here it is
6:48
sales Here I'm asking car service issue
6:52
It should not invoke the
6:54
topic It couldn't understand what I'm
6:58
talking about So it didn't
7:07
So here I said car service
7:10
issue it is related to sales so it
7:15
couldn't fire this or invoke this
7:18
topic but when I used service and then
7:22
when I entered car service issue it was
7:26
able to invoke the topic So I was able
7:29
to pass
7:31
pre-chart information to the agent force
7:35
agent and then I was able to make use of
7:38
filters in the agent force agent and
7:40
fire the topics based on the selection
7:44
in the
7:50
pre-chart Please check the video
7:52
description In the video description I
7:55
have shared my blog post
7:57
from the blog post you should be able to
8:01
get how how I have uh created the
8:05
field update the updated the messaging
8:07
session using the omni channel flow how
8:10
I have created the custom parameters and
8:12
parameters
8:14
mapping and how in the pre-hat I have
8:16
added
8:17
it also I have added screenshot for this
8:24
filter how the filter was was
8:27
created and how the messaging session
8:31
request type
8:33
was added to the context
8:41
variable I hope it was
8:49
helpful Thank you for watching
#Email & Messaging
#Internet Software
#Text & Instant Messaging
#Voice & Video Chat