Hiding Topics based on Portal in Virtual agent topic picker

Anusha Dande
Tera Contributor

Hi 

we got new requirement to make Virtual agent bot visible from servicenow to third party application but few topics should be hidden in third party applications

And we are trying to hide few topics using below code, but we are having below issues

1.It is not going to else part

2.Also, is  "vaContext" servicenow specific ? It will work for topic hiding on third party using "vaContext"

Any suggestions really helps

 

if(vaContext.portal == 'sp'){
gs.addInfoMessage('Testing VA portal Inside SP');
return true;
}
else
{
gs.addInfoMessage('Testing VA portal not sp');
return false;
}
5 REPLIES 5

Musab Rasheed
Tera Sage
Tera Sage

Hello @Anusha Dande ,

Please see below threads.

Article : https://community.servicenow.com/community?id=community_article&sys_id=563785fadb27b7c423f4a345ca9619f6

Thread : https://community.servicenow.com/community?id=community_question&sys_id=b987066b1b9adc108672ea89bd4bcb8e

Mark my answer as correct if that helps.

Regards

Please hit like and mark my response as correct if that helps
Regards,
Musab

Mark Roethof
Tera Patron
Tera Patron

Hi there,

Don't know if this also works for third party integrations, though worth trying:

find_real_file.png

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark
2020-2022 ServiceNow Community MVP
2020-2022 ServiceNow Developer MVP

---

LinkedIn
Community article, blog, video list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

Hi 

 

We found one issue, when we are trying with below code, we have seen in both KB and SB portals, it is returning portal name as "SP" only,  Can anyone please sugegst, from where portal name like "sp" or "kb" is returning. I have seen in portals, kb record is having "kb" as url suffix and "sp" has "sp" as url suffix but it is returning sp even for KB portal

if(vaContext.portal == 'sp'){
gs.addInfoMessage('Testing VA portal Inside SP');
return true;
}
else
{
gs.addInfoMessage('Testing VA portal not sp');
return false;
}
 
Any suggestions really helps alot

Hi there,

You could try something like:

if(vaContext.portal == 'sp' || vaContext.portal == 'kb'){

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark
2020-2022 ServiceNow Community MVP
2020-2022 ServiceNow Developer MVP

---

LinkedIn
Community article, blog, video list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn