Control Salesforce Agentforce Behavior in Voice Mode Using current modality
Aug 26, 2026
Show More Show Less
View Video Transcript
0:07
Hello everyone. In this video, we are
0:09
going to see how to dynamically control
0:12
the logic or the behavior of the agent
0:15
force employee agent in voice mode
0:18
versus text mode.
0:21
With the help of a system variable
0:23
current modality, we can control whether
0:28
the employee agent force agent is in
0:31
voice mode or in text mode. The current
0:34
modality system variable value will be
0:36
voice if the a if the end user is making
0:39
use of the voice icon to enable voice
0:42
mode. It will be text if they are typing
0:46
the information rather than making use
0:48
of voice mode.
0:52
Let's see a quick demo here.
0:56
This is my employee agent force agent.
0:58
I'm going to use text mode. Now
1:06
the prompt I have sent is create an
1:08
event. It created the event record and
1:11
then I'm able to see a
1:14
uh quick overview of that particular
1:17
event.
1:19
Now let me refresh.
1:22
I'm going to make use of voice mode.
1:28
Can you create an event?
1:43
In the text mode, I was able to preview
1:46
the event record that got created. But
1:51
when I used voice mode, it didn't
1:53
display that information because with
1:56
the help of system variable, I was able
1:58
to control that behavior.
2:01
If I go to
2:05
so this is my sub agent the instruction
2:09
is to create event record using create
2:11
event or task record using create task
2:14
agent action.
2:17
Once the record is created I'm saying if
2:20
this system variable current modality is
2:23
voice do not read aloud record
2:24
information and hyperlinks. If I use any
2:27
hyperlinks or any preview of data, I
2:31
don't want to display it. Here the
2:34
output is task record which is
2:37
displayable. And also the message
2:40
whether the event record got created or
2:42
not is also displayable in the voice
2:45
mode. I don't want to read aloud that
2:48
the that the event was created the event
2:51
name, subject, start time, end time and
2:54
all other additional information. the um
2:56
in the voice mode the response should be
2:59
short and crisp so that it will add more
3:03
value uh to the end users who is
3:06
conversing with the agent force agents.
3:11
So in order to dynamically control
3:15
the logic or the behavior of your agent
3:18
force agent, make use of the system
3:20
variable current modality.
3:31
Please check the video description. In
3:33
the video description, I have shared my
3:35
blog post. from the blog post you should
3:37
be able to get the sample agent script
3:39
for your reference. Here I have made use
3:43
of system variables
3:45
system variable current modality in two
3:47
sub aents. One is general FAQ. Whenever
3:51
uh if they are in voice mode I don't
3:54
want to read aloud um the entire
3:56
knowledge article to the end users. I'm
3:59
asking the user to disable the voice
4:00
mode for general FAQs so that the
4:02
knowledge articles will be displayed in
4:04
the chat window and the end users will
4:07
be able to follow all the steps that are
4:08
mentioned in the knowledge articles and
4:11
in the other sub agent which is a custom
4:13
sub agent I am making use of the same
4:16
current uh modality so that it won't
4:19
read aloud the record information and
4:21
the hyperlinks
4:29
I hope it was helpful.
4:39
Thank you for watching.
#Internet Software
#Science
