The CreatorCon Call for Content is officially open! Get started here.

Virtual Agent Context Variables

benm3
Mega Guru

Hi there,

I'm trying to determine the current portal URL by using a context variable, however, the variable always return undefined and I cannot seem to figure out why. Any help would be greatly appreciated!

Context Variable (I have removed answer and tried, remove 'getSession' and tried but no luck) is the attachment.

Condition script on virtual agent topic: 

    gs.log("Context plswork: " + vaContext.portalCheck, "BenTest");
    
    if(vaContext.plsWork.includes("locker"))
    return false;
    else
    return true;

 

 

12 REPLIES 12

Sarah McLaughli
Tera Contributor

Was this ever resolved? I'm also trying to do this without changing the URL.

Hi Sarah,

you can access the portal using the below, the below will execute when the portal is esc if not returns false. 

 if(vaContext.portal == 'esc')
    return true;
 else
    return false;

 

Thanks

Similar to the original question, we are not going to update the web client URL, like seen described here. We are hoping to determine the portal from the URL: https://<your-instance>.service-now.com/<portal>.

 

Href and GlideURI within the VA properties script does not work in getting the portal/URL.