0:05
hello everyone in this video we are
0:08
going to see how to pass data
0:11
from Salesforce messaging session to The
0:15
Bard for this demo what data I'm going
0:19
to pass whenever I'm using Salesforce
0:21
messaging for inapp and web to the B is
0:25
the site where the users are accessing
0:28
Salesforce messaging for inapp and web
0:32
services in messaging session object I
0:36
created a site field it is a custom
0:43
text in the messaging
0:48
Channel I created a custom parameter
0:52
site I have done the parameter mapping
0:58
flow the variable name in the flow
1:02
should be site and also the variable
1:05
name in the channel is site so the
1:08
mapping is done once this mapping is
1:11
done in the embedded service deployment
1:14
for the messaging for inapp and web I
1:16
enabled activate the pre-chat
1:20
feature in the hidden pre-chat Fields I
1:23
have selected the parameter that was
1:26
created in the messaging Channel
1:39
field and I made sure available for
1:41
input is selected so that when the
1:47
initiated this particular value that is
1:49
passed will be passed to the
1:54
flow in the flow I am updating the
1:58
messaging session record
2:01
with the site detail that was sent from
2:06
messaging next using route work I am
2:10
routing the messaging session to the
2:14
bot so before it is routed to the bot it
2:18
will make sure it is updating the
2:26
information once this is done it will
2:29
roue it to the bot in the bot I am
2:34
variables one is site custom variable
2:37
which is of type text site context
2:44
type text but the type here is context
2:47
for the site custom it is a custom
2:50
variable in the site context I have done
2:53
the context variable mapping with the
2:55
messaging session objects site field
3:02
this is the site where my experience
3:05
where my messaging for inapp and web
3:07
code is hosted so when I initiate the
3:11
messaging session I have to pass the
3:12
location so here the location is my uh
3:16
GitHub link this should be
3:21
using window. add event listener
3:25
whenever the on messaging ready event is
3:30
it will add a console statement and then
3:33
using embedded servicecore bootstrap
3:36
preat api. set hidden pre-art Fields
3:39
method I am passing this is the site
3:43
parameter the value will be
3:45
window.location.href so I'm going to
3:48
initiate the chat here so it is um I'm
3:52
accessing the messaging for inap and web
3:56
so let me refresh my page
4:01
okay so this is ready and then it fired
4:04
it set the value for site to
4:08
now when once I initiate the
4:13
chart my bot is involved and then my bot
4:16
is saying you are accessing our services
4:21
location one more important thing
4:24
is here I'm using set variable element
4:29
to set the context variable value to the
4:36
value and then I'm using the custom
4:40
variable name here to display what is
4:42
the value if I go to the messaging
4:47
sessions I should be able to see that
4:53
is stored in the site field
5:01
so we can definitely make use of hidden
5:02
pre-art fields to pass
5:05
data whenever we initiate messaging for
5:08
uh web and inapp session to the bot so
5:13
using hidden pre-art we can pass the
5:19
bot please check the video description
5:23
in the video description I have shared
5:24
my block post from the blog post you
5:27
should be able to get the sample code
5:30
for setting and passing the hidden
5:48
helpful thank you for watching