
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2021 02:24 AM
Hello everyone,
When VA Virtual agent communication is started it shows the greeting message and asks the user to select from "Show Me Everything Button" or Typing a Keyword/Sentence will do the NLU search and shows the results of topics,
During the topic discovery process (matching intents to topics), Virtual Agent returns the most relevant topics for a user's request. The topic discovery process returns these results to a user:
- Single match: When a user utterance directly matches an intent (topic), the topic runs automatically.
>Topic starts directly
My question:
When the topic started directly, I want to know by using what search team user landed on this topic?
I can't able to get the initial(topic discovery search term) search team.
Tried the following scripts but no luck
(function execute() { var res = ''; //Tried all the following but nothing is working /* vaVars */ res = vaVars.global_search_text; res = vaVars.search_term; res = vaVars.global_preChatExecuted; /* vaSystem */ res = vaSystem.global_search_text; res = vaSystem.search_term; /* vaInputs */ res = vaInputs.global_search_text; res = vaInputs.search_term; return res; })()
I have a contextual search inside my topic I want to trigger a contextual search with the topic discovery search term
Help is appreciated,
Thanks
Solved! Go to Solution.
- Labels:
-
AI Search
-
Virtual Agent

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2021 07:27 AM
I found it community after a long time:
Using the below code we can get the topic search text on the topic.
vaSystem.getSearchText();

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2021 03:59 AM
Hi there,
This will help you:
50+ (Un)documented Virtual Agent variables (vaInputs, vaVars, vaContext, vaSystem)
Mentions amongst others vaSystem.getSearchText()
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020, 2021 ServiceNow Community MVP
2020, 2021 ServiceNow Developer MVP
---
LinkedIn
Community article, blog, video list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2021 10:23 AM
Hi Mark,
Thanks for the response.
When I was looking for solution in the community I landed on your blog post (Article) > 50+ (Un)documented Virtual Agent variables (vaInputs, vaVars, vaContext, vaSystem).
Unfortunately, it's not helping my basic/simple requirement.
I want to retrieve the search term used for NLU search inside a topic.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2021 07:27 AM