Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Unable to fetch the value from Static Choice and Pass in other topic

Community Alums
Not applicable

Hi All,
I need help in one use case in Virtual Agent.
I am giving one static choice to users and I am trying to store the input from that static choice then I need that value in another topic based on which I will define some conditions.
What I did:
After defining choices, I have included one script Action to store the values:

(function execute() {
vaVars.selectedCategory='';
selectedCategory = vaContext.select_topic_related_to_your_problem;
})()
After this, I have defined the topic Switcher, it is switching perfectly, then in other topic I am trying to fetch the value like this:
(function execute() {
if(vaContext.selectedCategory == 'Software and Apps')
return true;
})()
But it is saying undefined. I am attaching the image. Please Guide Thanks
Topic 1: 
somu_pandey_0-1704174690900.png

Topic 2:

somu_pandey_1-1704174716177.png

Thanks
Vedant

1 REPLY 1

umaaggarwal
Giga Guru

Hi, 

Please try using a text step just to print if the value you passed from first topic is even moving to the second one.