Virtual Agent Topic

Adesh26
Mega Contributor

When the user enters a input in the virtual agent and the input gets mapped to a topic using the NLU inside the topic I want to use the original input entered by the user for something inside the topic any clues on how to do this?

3 ACCEPTED SOLUTIONS

Matthew_13
Mega Sage

Yes — you can do this, and it’s fairly straightforward.

At the very start of the topic, capture the user’s original utterance the text that triggered the NLU match into a topic variable, for example with a Set Values or Script step. Use the system value like User Utterance / Last user message, store it original_input and then reuse that variable anywhere later in the topic or pass it to a Flow.

Key point Here: grab it immediately, before asking the user another question, or it will be overwritten.

 

@Adesh26 - Please mark as Solution Accepted and Thumbs Up if you find Helpful!!

 
 
 

View solution in original post

kaustubhdub
Giga Guru

hey @Adesh26 
When a user types something into the Virtual Agent, that original utterance is automatically stored in the VA context. Even if the NLU maps it to a topic, you can still reuse what the user actually typed.
Virtual Agent Designer user input controls

Try the above article for any further help.

 

Hope that helps 🙂
Please mark this as helpful if it solved your issue, it’ll make it easier for others to find the solution too.

View solution in original post

Adesh26
Mega Contributor

Solution in script action 
(function execute() {
vaVars.user_message = vaSystem.getSearchText();
})();

View solution in original post

4 REPLIES 4

Matthew_13
Mega Sage

Yes — you can do this, and it’s fairly straightforward.

At the very start of the topic, capture the user’s original utterance the text that triggered the NLU match into a topic variable, for example with a Set Values or Script step. Use the system value like User Utterance / Last user message, store it original_input and then reuse that variable anywhere later in the topic or pass it to a Flow.

Key point Here: grab it immediately, before asking the user another question, or it will be overwritten.

 

@Adesh26 - Please mark as Solution Accepted and Thumbs Up if you find Helpful!!

 
 
 

kaustubhdub
Giga Guru

hey @Adesh26 
When a user types something into the Virtual Agent, that original utterance is automatically stored in the VA context. Even if the NLU maps it to a topic, you can still reuse what the user actually typed.
Virtual Agent Designer user input controls

Try the above article for any further help.

 

Hope that helps 🙂
Please mark this as helpful if it solved your issue, it’ll make it easier for others to find the solution too.

Adesh26
Mega Contributor

I did it using a script action with the script
Note : you should also create a script variable for this using the same variable name as below

(function execute() {
vaVars.user_message = vaSystem.getSearchText();
})();

Adesh26
Mega Contributor

Solution in script action 
(function execute() {
vaVars.user_message = vaSystem.getSearchText();
})();