- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-16-2020 06:05 AM
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
Solved! Go to Solution.
- Labels:
-
Virtual Agent
- 6,829 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-21-2020 04:51 AM
I updated the main topic with a solution, thanks for the help everyone

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-17-2020 10:51 AM
That doesn't look the system log? How are you testing this? If you are using the preview: no go, won't work.
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
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
‎07-17-2020 11:19 AM
I was using the virtual agent previewer before
I changed it to try to output as a bot response so I can test it outside the previewer and seem to run into the same issue running the chat from /$sn-va-web-client-app.do
I made it the first message in our greeting topic
If i use the full JSON line you provided I get the bot technical issues message
JSON.parse(vaVars._topic_current).task
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-21-2020 04:51 AM
I updated the main topic with a solution, thanks for the help everyone

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-21-2020 05:22 AM
Don't leave us in suspense! How did you figure this out??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-21-2020 06:27 AM
I opened a Hi Support Case, I'm not sure how anyone would find these hidden variables without asking the SN support.
Object.keys(obj) *should* be able to find things like this, but doesn't seem to work in most cases.
From searching around these vaVar variables prefixed with "_" appear to be undocumented.