can we call url in script action virtual agent?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-30-2022 08:05 AM
Hi
I am trying to call url in virtual agent script action using window.open('url',"_blank').
but it is giving an error. is there any other option to open url directly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-30-2022 08:24 AM
Hi GN,
This thread should help you :
Mark my answer correct & Helpful, if Applicable.
Thanks,
Sandeep

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-06-2022 05:55 AM
window.open is client-side Javascript - VA scripts are all run server-side so I can see that that wouldn't work.
I'm not sure it's possible to automatically open a URL from VA but your best bets to check would be a) look on ServiceNow's API documentation: Server Global API | ServiceNow Developers and/or b) search the Developer Community (not VA-specific) to see if there's an undocumented API that can open a URL.
The simplest - and arguably best* - solution is to just provide the hyperlink to the URL in a text/link response for the user.
*I say arguably best because, from a UX perspective, it's not a good experience to suddenly have a different window appear from no action of your own. At this point, it acts almost like the dreaded Web 1.0 Pop-up Ad.