Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

VIrtual Agent Topic visibility user specific

marcinkopiec
Giga Contributor

Hello, is there any way to make a topic visible for specific users and not visible for others?

In details, I need to make it visible if the "company" attribute from the user record has specific value.

Should it be done within topic properties script condition? Is there a kind of variable that can be used (similar to "vaContext.liveagent_portal" one but dedicated to logged in user)?

 

Regards

Marcin 

1 ACCEPTED SOLUTION

Muralidharan BS
Mega Sage

Hi Marcin,

yes there are options to make it visible for only specific users. 

1. Go to VA designer

2. Open topic, go to properties

3. open the script section and paste the value

find_real_file.png

 

(function execute() {
    if (vaInputs.user.company == 'name of company of sysid')
        return true;
    else
        return false;
})()

if the company name is a reference then pass the sysid or else string value. You can also use getDisplayValue() to get the company name. 

Thanks

View solution in original post

10 REPLIES 10

Were you able to see the Role section?

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Yes Role section is there but I want to restrict the topic visibility based on logged in user's Location. Lets say users belonging to USA location only should be able to see that topic and also that topic should be visible in 'Show me Everything' topic list at the beginning of the VA chat for only that location users.

Hi @Nasreen2 

 

I am at Zurich and i can see the script option

 

DrAtulGLNG_0-1763571321246.png

 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Yes in that script section whatever code mentioned above is not working . Instead of company, I gave location but it is not working.

 

(function execute() {
    if (vaInputs.user.company == 'name of company of sysid')
        return true;
    else
        return false;
})()

  

Sai Gopal
Tera Contributor

how to make the topics visible on the login page?