Get last utterance from user with vaSystem.getSearchText()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2024 01:30 PM
I know that the user's last VA utterance is stored in vaSystem.getSearchText()
I am using this script within a Topic, so I can access that string, and I created the associated script variable. But the variable "desc" is returning "null". This seems straightfoward - what am I doing wrong?
Script:
(function execute() {
var desc = vaSystem.getSearchText();
return desc;
})()
Script Variable
desc
For example, within the topic, I want to save the string "I need admin rights" (typed after the greeting) as a variable:
Thanks in advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2024 12:08 PM
Ok, I have this working now - hope it helps someone else!
Script: Bot Response (Orange) - to print vaSystem.getSearchText() value to screen
Script:
(function execute() {
var desc = vaSystem.getSearchText();
return desc;
})()
Script Variable
desc
Script: Utilities (Black) - to save vaSystem.getSearchText() value as a VA variable
Script Variable
user_typed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2024 04:07 AM
Hi @MB Richards
I am exactly facing the same issue while modifying in anything else topic.
I tried in the same way you have mentioned. But, still vaSystem.getSearchText() returns null. I have attached all screenshots for your reference.
Your help on this would be appreciated
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2024 08:21 AM
After struggling with for so long, I also just found an example in the Search Fallback Topic. Just look for the "User Search Text" node. Make sure to add the Script Variable as well.
I hope this helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2024 10:26 PM
Hi @MB Richards ,
It is not working yet. I have attached the complete recording of what I have done. Could u pls check and revert.
Its better if you record and send the working flow