How to pass Value from one topic to another in Virtual Agent
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2024 02:05 AM
Hi All,
I have a requirement of passing a variable from one topic to another topic.
I am defining one variable like this to store the user input:
In another topic I am parsing one system Property like this:
But in logs I can see in the second topic where I am fetching the value, it showing selectedCategory is not defined.
How I can make it work so that selectedCategory should store correct value that is Hardware, to give it's corresponding sysId.
Kindly Guide.
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2024 02:11 AM
Hi there,
Instead of vaVars, you could try to use Context Variables.
From the Docs:
"They work in a global scope whereas system variables work within the scope of the topic. You can use context variables anywhere in the conversation using the vaContext
object."
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
01-08-2024 02:26 AM
Thanks @Mark Roethof
@Mark Roethof
I have tried that also.
First in conversational Interface I defined the variable called LiveAgent_selectedCategory
then in first topic:
I have used:
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2024 02:29 AM
"It's not working". So what's not working? I do assume the same not defined message on:
LiveAgent_selectedCategory = vaInputs.select_topic_related_to_your_problem.getValue();
Basically, because indeed, you did not define this. Same mistake as in your previous post.
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
01-08-2024 02:34 AM
@Mark Roethof Didn't get you, can you please elaborate please