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

Muralidharan BS
Mega Sage

Channeling Virtual Agent Topics by Device and Platform

 

This approach provides a foundation for granular control over VA topic availability based on user access points. You can adapt the script condition to target specific device types (mobile, Teams, Facebook) as needed.

 

Here's the breakdown:

  1. Leveraging Device Type: When a user interacts with the VA (mobile app or web interface), a new conversation record is created in the sys_cs_conversation table. This record includes a "device type" field that identifies the user's device.

  2. Topic-Based Access Control: Each VA topic has a "condition" field where custom logic can be defined using scripts. Here's an example script that grants access only to users connecting via Slack:

 

Open any VA topic and click on the properties tab. This script below checks the user is logged in from Slack and grants access.

 

(function execute() {
var device = vaContext.deviceType === 'slack';//mweb,teams,ios,android,facebook,messenger
return device
})()

 

By implementing these concepts, you can tailor the VA experience to best serve users on their preferred platforms.

 

Thanks,

Murali

Comments
Nauman
Tera Contributor

Hi Murali,

Appreciate your post, I need small help while opening the Service portal on Teams how can I hide the VA icon to display?

 

Muralidharan BS
Mega Sage

Hi Nauman, 

 

I don't think this will be possible when you use an agent chat configuration. But if you use Virtual Agent Widget in the Service Portal, then you can customise the widget - sn-va-sp-widget to show/hide the icon based on the user agent. 

 

var uAgent = window.navigator.userAgent;
 
use this in the client controller and log it. Try to access the VA from both SP and Teams. Find the difference between two user agents and hide the teams user agent. 
 
Hope this helps!
Mohammed Nauman
Tera Contributor

Thanks, @Muralidharan BS  This Helps 🙂 

Version history
Last update:
‎06-21-2024 06:02 AM
Updated by:
Contributors