How to make VA bot response link as dynamic (ie. instance dependent links, a link clicked on test instance VA redirects to test instance)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-10-2022 10:52 PM
Hi,
I need to add links for catalog items in the bot response of VA. I need to make them as dynamic so that when link is clicked on dev environment it redirects to a item in dev and when same thing is accessed using test instance VA it redirects to item in test.
One thing to keep in mind is that I have to do MS teams integration with VA and the links should work dynamic there also.
Any suggestion would help.
Thanks
- Labels:
-
Virtual Agent

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-12-2022 04:46 AM
Hi Prathvi,
There are multiple ways of doing this.
The best and easiest way to do this is to omit <https://instanceName.service-now.com> from your url and just give the rest of the url as a hyperlink. Virtual Agent will automatically prefix the instance url dynamically according to the current instance.
For example if your URL is "https://dev2345.service-now.com/serviceportal", just use "/serviceportal" in the hyperlink.
Another way to achieve this is using getProperty() function. You can use gs.getProperty('glide.servlet.uri') to get the current instance URL.
For example if your URL is "https://dev2345.service-now.com/serviceportal", You can create a script variable with a code which returns gs.getProperty('glide.servlet.uri')+"/serviceportal". While doing hyperlink, you can use this variable as hyperlink instead of giving a url.
Please let me know if you need to know more about this.
If you find my answer useful for you, please mark it as helpful!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-13-2022 10:53 AM
Your first option doesn't work with the Teams integration sadly from experience. But thanks for sharing the second option because I didn't think of that one!