Hide Topics in portals virtual agent

dheeru_1994
Tera Contributor

Hello all i have requirement in virtual agent  i have to show topic in my custom portal , portal name is test , and hide from sp portal , my virtual agent topic is hello world , properties  there is for scripting 
i write this script 

 

(function execute() {
if(vaContext.portal == 'test'){
return true;
}
else
{
return false;
}
})()

 

but it is disapearing from service portal as well as test portal 
i tryied but no luck 
any help will highly appreciated 

@Mark Roethof 

2 REPLIES 2

Sujatha V M
Kilo Patron
Kilo Patron

@dheeru_1994 Not sure if you have configured the below. Just sharing it as per the below support case, 

 

In your portals, you have to generate URLs with "sysparm_portal" parameter in order to read them from the Virtual Agent conditions. You can use this parameter as  "vaContext.portal" in the condition for Virtual Agent topics.

 

Referring @Mark Roethof comment on the posthttps://www.servicenow.com/community/virtual-agent-nlu-articles/virtual-agent-available-topics-depen...

 

To configure URL parameters through the instance options, see this article:
https://community.servicenow.com/community?id=community_article&sys_id=1ce3cd66db9e88101cd8a345ca961...

To configure the URL directly in your widget, you would need to clone the "Virtual Agent Service Portal Widget" widget and edit the URL in the Client Controller/Client Script:
$ctrl.vaSource = '/$sn-va-web-client-app.do?sysparm_nostack=true&sysparm_stack=no';

 

Please mark this as helpful and accept it as a solution if this resolves your query.

Thanks,

Sujatha V.M.

 

 

Please mark this as helpful and accept it as a solution if this resolves your query.
Sujatha V.M.

sonali9
Tera Contributor

Hi @Sujatha V M , we have two portals test and sp, do we need to update below code with one of the portal suffix, I am not sure how we can update widget, I have checked above links but not able to find how we can update widget code or in option schema, could you please provide more information or steps to update widget.

sonali9_0-1716290821098.png