Virtual Agent links to Catalog Items open in the current browser window

mpmacconnell
Tera Guru

I am creating topics that will link to specific Catalog Items. Currently when clicking these links they open in a separate tab. Is it possible to have these links open in the current browser window?

 

Here is a sample of the code I am using:

(function execute() {
/* Return a quoted string. For example:

var result;

*/
var baseURL = gs.getProperty('glide.servlet.uri');
return baseURL + 'sp?id=sc_cat_item&sys_id=50ce6609ec778e00c3ed192aba465fed';
})()

1 ACCEPTED SOLUTION

Mark Roethof
Tera Patron
Tera Patron

Hi there,

I assume you are using the Bot Response Link? If so, it's like Ankur mentioned. That's the default behavior, and you don't have a configuration option to change this.

Though, you could use Bot Response HTML for example. Scripting your link and what the target will be. It's not perfect, though _parent as target works.

For example:

<html>
    <body>
      <a href="/sp?id=sc_category" target="_parent">Your URL</a>
    </body>
</html>

(= tested)

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

LinkedIn

View solution in original post

4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

@mpmacconnell 

that is the default behavior.

possibly you cannot change that since if you open the page in same window the VA conversation will possibly end and that is not what user expects

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Mark Roethof
Tera Patron
Tera Patron

Hi there,

I assume you are using the Bot Response Link? If so, it's like Ankur mentioned. That's the default behavior, and you don't have a configuration option to change this.

Though, you could use Bot Response HTML for example. Scripting your link and what the target will be. It's not perfect, though _parent as target works.

For example:

<html>
    <body>
      <a href="/sp?id=sc_category" target="_parent">Your URL</a>
    </body>
</html>

(= tested)

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

LinkedIn

Hi Mark,

This works for me but I have one more issue.

The link from portal (xyz) should take users to "xyz" portal, and a link from Mobile should take users to a "mesp" i.e. Mobile Employee Service Portal from same flow.

My query is, how would I find if the view is mobile or portal in topic flow, with which I can configure which portal to redirect to.

 

Appreciate any help on this.

 

Thanks,

Anagha

How to pass sys id in below URL:

 

<html>
   <body>
      <ahref="/x_dtti_dividend_my_holdings.do?PDF&sys_id='+vaVars.holding_selected+'&sysparm_record_target=x_dtti_dividend_my_holdings&sysparm_record_row=1&sysparm_record_rows=21&sysparm_record_list=ORDERBYDESCsys_created_on"target="_blank">Click here to download the statement</a>
   </body>
</html>
"vaVars.holding_selected" contains sys id of record.
 
Is this the right way to pass the sys id?