- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2020 11:00 PM
We have virtual agent chat in out home page of portal and we want it open/pop up automatically when page loading finishes. It there any way through programming or configuration setting to make it happen?
What exactly should be the code changes? I f somebody has done it earlier please paste it over here too.
Solved! Go to Solution.
- Labels:
-
Virtual Agent
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2020 08:05 AM
- Clone the out-of-the-box widget
- Apply the cloned widget to your Service Portal page or header/footer
- Update the Client controller and CSS script like below


If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP
---
LinkedIn
Community article list
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
09-05-2024 03:08 AM
Hi Mark Could you share the script again I cant see it attachment is not there
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2020 01:29 AM
I have cloned virtual agent widget and kept it in footer.
In above it is opening on initial home page load as well so How to restrict to open virtual agent window to first click that means if user logged in i don't want virtual agent window to open.
only when user click on it should open but when user has opened virtual agent it should be opened in next page of the portal how to achieve this ?
once i click on the incident link it is opening other page on the other page virtual agent window is not active if i have to open again i have to click. i saw client script and CSS but it didn't helped.
I have cloned it and configured it in footer if i use agent chat configuration it is behaving as i have explained (when VA is open it is still open in next page of portal)
please help if i am going wrong somewhere.
please help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2020 12:02 AM
Nice solution from Mark, as ever.
If you're cloning the widget, there is another way, which is to trigger the toggleWindow() function in the widget Client controller. You could do this every time the widget loads, or introduce some controls over it by using a $scope.on listener in the VA widget, and then doing a broadcast/emit from any other widgets on your page.
As an example of the latter, we show calculate and show counts of open requests and approvals in the our SC portal header. When the header loads, we check for the page id (only on the home page) and whether there are open requests or approvals. If these conditions are met,we make that broadcast, which is picked up by the VA widget listener and calls the toggleWindow() function.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2020 07:46 AM
Hi dants,
I tried to call the toggleWindow() function inside div tag, but was not able to open the chat bot on load.
-------------------------------------------------------------------------------------
<div class="conversation-button-container" onLoad="$ctrl.toggleWindow()" >
<div class="conversation-region fade"
ng-class="{'open': $ctrl.isWindowVisible}">
<div class="sn-connect sn-connect-floating">
<div class="sn-connect-floating-wrapper loaded">
<div class="conversation-container">
<iframe title="${Chat Support}" class = "chat-frame" scrolling="no" horizontalscrolling="no" verticalscrolling="no" frameborder="none" ng-src="{{$ctrl.vaSource}}">
</iframe>
</div>
</div>
</div>
</div>
<button
aria-label="${Start Support Conversation}"
class="help-button"
ng-attr-tabindex="0"
ng-class="{'state-open': $ctrl.isWindowVisible, 'state-unread': $ctrl.hasUnreadMessages}"
ng-click="$ctrl.toggleWindow()"
ng-style="{'background-color': $ctrl.options.button_color}"
ng-attr-tabindex="0"
>
<div class="hover-overlay"></div>
<span aria-hidden="true" ng-class="$ctrl.isWindowVisible ? 'help-icon icon-close icon-cross' : 'help-icon icon-open sn-va-widget-icon'"></span>
</button>
</div>
--------------------------------------------------------------------------------------------
Can you help to identify the issue or appropriate way of calling function.
Thanks you in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2021 06:46 AM
Hi Mark,
Will your solution only work for the legacy Virtual Agent widget? Will this also work for the new Virtual Agent chat widget that we access via Service Portal > Agent Chat?
Best Regards, Lener
