Virtual Agent current interaction record via script

Sean C
Mega Guru

Is there a method to get the current Virtual Agent [Interaction] record in a virtual agent script?

I am trying to access the current interaction record at the end of a conversation to determine if a live chat has occurred or not (based on assigned to either being the Virtual Agent Bot or a real person)

So far i have tried the obvious stuff based on the documentation out there,but nothing specifically mentions this capability.

The 'current' and 'vaSystem' objects do not appear tied directly to the interaction unless i'm accessing them incorrectly

 

Anyone ran into a similar situation and solved this?

 

[Update]

vaVars._interaction_record_sysid will give you the interaction sys_id

and

vaVars.global_vCurrentTopicId will get you the current conversation id

1 ACCEPTED SOLUTION

I updated the main topic with a solution, thanks for the help everyone

View solution in original post

18 REPLIES 18

One would think that if they're going to reveal these details to customers when they request them, it'd save a whole lot of headache to simply document them formally...

Honestly, we need a wiki for all the undocumented VA knowledge from this community. Mark's got an awesome list of things he's worked on, including other useful variables and functions.

p.s. Object.keys(obj) was actually one of the things I did originally when I spent time looking into it but I'm not a real developer so I didn't want to sound stupid just in cased I missed something in my amateur analysis of it 😬

I'm facing the same issue. It doesn't work.

Any alternate approach?

This might help you:
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

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

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

LinkedIn

Bipul Vishwakar
Tera Contributor

I am working on the same, still it is not working