Brad Tilton
ServiceNow Employee
ServiceNow Employee

Note: This blog post reflects my own personal views and do not necessarily reflect the views of my employer, Accenture.

One of the things that I learned early on in working with Service Portal is that while there are relatively few types of artifacts to track, namely portals, pages, widgets, and widget instances there are multiple ways to view most of them. It was a bit confusing for me to be able to get to the right view of the page or widget I wanted at different times, sometimes taking me a few clicks, even when using the sp_config portal.

At some point I saw something that changed how I worked with Service Portal pages and widgets: CTRL+Right-Click. If you have the admin role and are looking at a rendered service portal page you can CTRL+Right-Click on any widget (think content rather than blank space) and get a menu with some great options in it.

EditorContextMenu.png

Let's walk through those here and I'll provide links to the documentation on the ServiceNow docs site and/or service portal documentation on github where applicable.

  • Widget Performance - The very first message tells you how long it took for the widget to load, which is a nice little feature.
  • Instance Options - You can specify options when someone adds a widget to their page which can determine how the widget is rendered. Choosing this option gives you an overlay where you can edit the values of the options for this widget instance.
  • Instance in Page Editor - This shows you the widget instance in the page editor view, with the hierarchy of all the containers, rows, columns, and widgets on the page. Clicking on a widget allows you to edit the the widget instance fields.

  • Page in Designer - Designer lets you add containers, columns, and widgets to a page as well as setting some styling for those artifacts.
  • Edit Container Background - This one allows you to change some of the styling of the container where the widget you clicked is located.
  • Widget Options Schema - I mentioned a bit earlier that you can edit the values for the the options of the specific widget instance you're clicking on, but this let's you edit the options definitions for the widget. If you wanted to collect an additional data point and use it in the widget definition you would do that here.
  • Widget in Form Modal - This opens the widget form in a modal overlay. You can edit field such as demo data, etc. The widget form itself isn't all that useful and there is a better alternative.
  • Widget in Editor - This is where I have spent most of my time since I've been working in Service Portal and it's an incredibly useful tool for writing and editing widgets.
  • Log to Console: $scope.data - This is one of my favorites. In Service Portal, the $scope.data object is what is used to pass data from the server to the client side controller. If you're having issues with some data coming through, instead of adding console.log messages or even alerts into your controller code, you can just log the $scope.data object to your browsers console and take a look at the data there. You could always add this to every widget and turn it on and off, but it's just a whole lot easier to render a SP page, realize that you didn't return some data you thought you would, then look at the logs without ever leaving the page.
    *Could not find any documentation on this
  • Log to Console: $scope.data - This is much like the previous, except it logs every thing in $scope to the console, so you'll get a lot more noise here, but it can be useful if you're looking for something other than data.
    *Could not find any documentation on this

I hope this was a useful explanation of some other feature within the CTRL+Right-Click functionality in Service Portal. I plan on going into a bit more detail on some of these topics in future blogs.

2 Comments