The Zurich release has arrived! Interested in new features and functionalities? Click here for more

How to restrict a HR Topic in Virtual Agent based on country or role

Madhav Rao D V
Tera Expert

Is there any way to restrict a HR Topic in the Virtual Agent based on a specific country or a specific role or both??

1 ACCEPTED SOLUTION

Lokesh Majeti
Tera Expert

If you want to do the restriction in global scoped virtual agent topic you can just go to VA Topic>Properties>Advanced Properties>context>script and use vaInputs as shown below to get the user table data and keep all the required conditions of your choice.

if(vaInputs.user.location.country !='RU' && vaInputs.user.u_user_type !='contractor')
return true;
else
return false;

But when you consider a HR virtual agent Topic vaInputs doesn't work in HR scope so you need to glide through tables and get required data and use it to put conditions.

Here I am attaching a sample code to restrict RU user, contractors, and a role

 

satya_loki_0-1688032690638.png

 

FYI. getRecord() object doesn't work across applications so avoid using it.

View solution in original post

1 REPLY 1

Lokesh Majeti
Tera Expert

If you want to do the restriction in global scoped virtual agent topic you can just go to VA Topic>Properties>Advanced Properties>context>script and use vaInputs as shown below to get the user table data and keep all the required conditions of your choice.

if(vaInputs.user.location.country !='RU' && vaInputs.user.u_user_type !='contractor')
return true;
else
return false;

But when you consider a HR virtual agent Topic vaInputs doesn't work in HR scope so you need to glide through tables and get required data and use it to put conditions.

Here I am attaching a sample code to restrict RU user, contractors, and a role

 

satya_loki_0-1688032690638.png

 

FYI. getRecord() object doesn't work across applications so avoid using it.