Is there a script to get the name of the current topic in Virtual Agent
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2020 03:34 AM
Hello,
Is there a script that I can use in a topic to get the name of this current topic and save it in a variable?
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2020 04:07 AM
Hi there,
Yes and no. There's no actual vaSystem property for this directly. Though, there's a workaround 🙂
(function execute() {
return JSON.parse(vaVars._topic_current).name;
})()
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP
---
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2021 06:22 AM
Hello,
thanks for your post that's helps me 🙂
Where I can find details on vaVars differents fonction like vaVars._topic_current or vaSystem.switchTopic()
Do you have some documentation with theses commands ?
Kinds regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2021 06:28 AM
Hi there,
Not sure what you are asking, though maybe this helps:
50+ (Un)documented Virtual Agent variables (vaInputs, vaVars, vaContext, vaSystem)
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
---
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2021 11:02 AM
Thanks 🙂