The Now Platform® Washington DC release is live. Watch now!

Help
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
jesseadams
ServiceNow Employee
ServiceNow Employee

Ever feel like your Service Portal page has a widget or two that is slow to load? It happens. When your widgets are sluggish, how do you diagnose your Service Portal to identify the slow widget? How can you easily narrow down which widgets are contributing to the slowness so that you know where to focus your development efforts?

I have a script that will allow you to easily determine which widgets are causing slowness on your Service Portal page!

Service Portal Page Performance Diagnostic script.

This script will allow you to quickly and easily see how long each widget on the page takes to load. Simply paste it into the browser console on your portal page and hit enter.

find_real_file.png

 

How the script works to determine slow widgets

This script goes through and reloads each widget on the page individually, then tells you how long it took.

It adds a red outline to each widget showing which part of the page that widget is responsible for, as well as adding the widget's name, a button to print the widget's scope to the console and another button to refresh the widget.

Additionally, at the bottom of the page, a new section will be added which displays a table of all of the widgets which took longer than the threshold specified in line 2 of the script.  That can easily be copied as markdown via the "Copy Markdown" button if needed.

find_real_file.png

It's worth noting here that embedded widgets (widgets loaded inside of other widgets) wont be reloaded automatically here.. they're usually dependent on the parent widget in order to work properly so by default they're skipped but, you can always click the refresh button on the widget if you need to reload it manually. 

Click here to get the script 

So, next time you find one of your portal pages loading slowly give this script a try. It should make narrowing down the widget or widgets causing the issue much easier and less tedious. If you're stuck on where to go from there, then check out this KB containing best practices for avoiding widget performance issues: Six common performance pitfalls in Service Portal and how to avoid them

9 Comments