We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

Virtual Agent Redirects Shared Links Back to sn_va_web_client

RicardoSanchez
Tera Contributor

When an agent shares a link, for example a catalog item URL, the end user clicks the link and is redirected to the sn_va_web_client instead of the intended destination. Each time the user clicks the link, it loops back to the Virtual Agent web client without navigating to the actual URL.

3 REPLIES 3

PREMSAIA
Tera Contributor

@RicardoSanchez 
This could be due to an incorrect instance-level configuration for the property "glide.servlet.uri".  Follow this steps:
1. Search for the glide.servlet.uri property. Set the property to the correct host value. 

2. Also, update the URL navigation in the `sys_cs_portal_url_mapping` table.

sandeepdutt
Tera Patron

HI @RicardoSanchez ,

 

You should focus on Opening this LInk on the new tab, which should fix this issue.

Try using "HTML" Component in place of "Link":

SANDEEPDUTTA_0-1770177157152.png

 

In the Script section of the HTML (Bot Response): use this Pseudo code:

(function execute() {
    // 1. Set the Sys ID of the item you want to link to
    // (Or use vaInputs.your_variable if it's dynamic)
    var targetSysId = 'YOUR_CATALOG_ITEM_SYS_ID_HERE'; 
    
    // 2. Construct the Absolute URL
    // gs.getProperty('glide.servlet.uri') automatically gets your instance URL (e.g. https://dev123.service-now.com/)
    var fullUrl = gs.getProperty('glide.servlet.uri') + 'sp?id=sc_cat_item&sys_id=' + targetSysId;

    // 3. Construct the HTML Anchor Tag
    // target="_blank" is the CRITICAL part that prevents the loop
    var htmlLink = '<a href="' + fullUrl + '" target="_blank" style="text-decoration: underline; color: #1f8476; font-weight: bold;">Click here to view the item</a>';

    return htmlLink;
})()

SANDEEPDUTTA_1-1770177501789.png

 

Thanks,
Sandeep Dutta

Please mark the answer correct & Helpful, if i could help you.

@sandeepdutt  This is not occurring in Flow. The issue happens when the Live Agent shares a link with the end user.