Chat icon in portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2023 12:31 AM
I want to hide the virtual agent chat icon for the c3i users that is where the users are with special instructions containing C3i full support. How can it be achieved.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2023 12:41 AM
Hello @hd_123,
To hide the virtual agent chat icon for the c3i users, you need to customize the Service Portal widget for Virtual Agent (sn-va-sp-widget) and add some logic to check the user’s special instructions field. You can use the GlideSystem user object and its methods to get information about the current user, such as their user ID, company, department, location, etc. You can also use the GlideRecord object and its methods to query the user table and get the value of the special instructions field.
Here is a possible code snippet that you can use to hide the chat icon based on the user’s special instructions:
// Get the current user object
var user = gs.getUser();
// Get the user sys_id
var userID = user.getUserID();
// Create a GlideRecord object for the user table
var grUser = new GlideRecord('sys_user');
// Query the user table by sys_id
grUser.get(userID);
// Get the value of the special instructions field
var specialInstructions = grUser.getValue('special_instructions');
// Check if the special instructions contain C3i full support
if (specialInstructions.indexOf('C3i full support') > -1) {
// Hide the chat icon
data.hideChatIcon = true;
} else {
// Show the chat icon
data.hideChatIcon = false;
}
You can find more information about how to configure the Service Portal widget for Virtual Agent in this article.
Hope this is helpful.
Kind Regards,
Swarnadeep Nandy

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2023 12:47 AM
Hi there,
Are you using Agent Chat configuration? Or are you using a legacy Service Portal widget (or cloned/custom widget)?
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2023 01:22 AM
Service portal agent Chat Config
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2024 06:32 AM - edited ‎08-23-2024 06:33 AM