
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2019 03:45 AM
Hi all,
Just out of curiosity, I was wondering, would it be possible to have a widget on the Service Portal appearing / making visible / etc. on a certain condition like:
- After 1 minute visiting a page
- After 3 times typing a search
It's just out of curiosity. Though I was thinking maybe it would be nice to have something like a custom Virtual Agent widget automatically popping up to assist an employee.
Curious if anyone has an idea on this.
Kind regards,
Mark
---
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
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2019 03:59 AM
Hello Mark,
Yes this should be possible.
So lets say you want to auto populate a virtual agent after 1 minute of visiting a page. This is possible using the $timeout. You could trigger the virtual agent dynamically after the timeout specified in your page's widget. What this does is a late loading of widgets. The same logic can be applied on search, you may need to have additional data which say this is my third search in last 15 minutes or so. You could find sample scripts to load virtual agent in the CSM portal header menu widget.
Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2019 03:58 AM
Hi Mark,
That would be possible with ng-if condition on that particular <div> that we need to show. Like for the first on, we need to set the start time and set the flag to +1. once the time is elapsed we can refresh the server once more which will set the flag value to false and the $scope.apply() method of AngularJS will internally check that flag and toggle the div automatically.
Hope this is what you were looking for. That something like a "Good to have" kind of functionality. Would surely give this a try.
Regards
Omkar Mone
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2019 03:59 AM
Hello Mark,
Yes this should be possible.
So lets say you want to auto populate a virtual agent after 1 minute of visiting a page. This is possible using the $timeout. You could trigger the virtual agent dynamically after the timeout specified in your page's widget. What this does is a late loading of widgets. The same logic can be applied on search, you may need to have additional data which say this is my third search in last 15 minutes or so. You could find sample scripts to load virtual agent in the CSM portal header menu widget.
Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-11-2019 10:44 AM
Eventually I created a widget with the timeout in the link field. After x seconds, a div that has ng-if will evaluate to true and will be shown. Did added some more logic, though the timeout idea was the first step.
Tnx!
Kind regards,
Mark
---
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
04-13-2021 01:53 PM
Hi Mark,
Could you please share how this is done?
Thank you!