logo

NJP

Using Virtual Agent vaVars through the data pill

Import · Jul 27, 2020 · article

Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

Hi there,

Between the London release and Madrid release, ServiceNow enhanced the Virtual Agent designer with amongst others, the Data pill. A nice addition, like we already knew it in Flow Designer. While working on the Virtual Agent designer and the Data pill, I stumbled on one annoying little thing… Why can't I select my vaVars Script Variables?!

vaVars Script variables

Let's first set up a basic Virtual Agent topic through the Virtual Agent Designer. Just using a Script Action Utility which contains a vaVars variable, which we would like to use in another utility in our Virtual Agent topic.

image

image

Data pill [introduced in Madrid]

We've set up the vaVars variable. Though how come we can't use this on the data pill which is available?

image

vaVars and the Data pill

Defined vaVars during your Virtual Agent topic design, are not automatically recognized. There's a small workaround for this. Adding the variables in the Script Variables section. Ones added, the vaVars variables are directly available in the data pill.

Note there is a downside of this workaround: all defined variables this way, are already available on your first step in your topic design. So already before you are actually doing anything with these variables.

image

image

image

Note: This will also work when working in the Virtual Agent Designer within script. When typing vaVars., all of your vaVars defined will be recognized and available with the auto-complete.

image

---

And that's it. Hope you like it. If any questions or remarks, let me know!

Kind regards,

Mark Roethof

ServiceNow Technical Consultant @ Quint Technology

1x ServiceNow Developer MVP

1x ServiceNow Community MVP

---

LinkedIn

image

View original source

https://www.servicenow.com/community/virtual-agent-nlu-articles/using-virtual-agent-vavars-through-the-data-pill/ta-p/2306365