Join us Dec. 16 for The Community Hour, our first global virtual User Group event!

Is there a script to get the name of the current topic in Virtual Agent

Ivan Delchev
Giga Contributor

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!

 

9 REPLIES 9

Mark Roethof
Tera Patron

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

---

LinkedIn
Community article list

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,

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

---

LinkedIn
Community article, blog, video list

Thanks 🙂