As you may know, the newest addition to the ServiceNow family “Madrid” will be released sometime this year. In addition to a new interface, bug fixes, and enhancements, it's also expected to include several new updates to Service Portal. In this [...]
WHAT IS "OUT OF BOX" One of the most common requests we hear when developing a portal is, "stay close to out-of-box". People usually think this means staying close to the look and feel of the Stock theme, in hopes that it will minimize complications with future upgrades. This common misconception has very little to do with the portal theme, and everything to do with how many and which widgets were cloned. Staying out-of-box has nothing to do with the theming, look or feel of the portal, but how many of the widgets were cloned. The real danger of “stay close to out-of-box” is that it leaves little-to-no room for: Adhering to company required branding guidelines Delivering a delightful user experience Meeting business requirements So how do you stay close to out-of-box and ensure a smooth upgrade process without sacrificing the look, feel and functionality of the portal? In this article, we'll outline various approaches to help you deliver a portal without sacrificing the user experience. WHAT NOT TO CLONE Before we talk about what you can safely change, let’s talk about what you shouldn’t change. Changing a ServiceNow widget involves cloning it. When you clone a widget, you become responsible for ensuring your widget continues to function as expected after a ServiceNow upgrade. If a widget with complex logic is cloned and you want to align it with the recent upgrade, you may need to analyze both original and cloned widgets line-by-line to determine what changed and to ensure nothing has stopped working. We know from experience that some widgets tend to change quite often, even within patches and hot fixes! For that reason, we recommend that you avoid cloning any widget with complex logic. Some examples include: Shopping cart Catalog item Approvals Order guide Data table Form Before you clone a widget, consider the additional effort it will require to maintain the widget with each upgrade. In many cases, with a little creativity, it is possible to meet business or branding requirements without cloning. WAYS TO AVOID CLONING A WIDGET We’ve found quite a few ways to avoid cloning while still meeting requirements. Here are some suggestions in a rough order of difficulty. INSTANCE OPTIONS Many widgets already have instance options for configuring the behavior and look of the widget. You can access the options by pressing CTRL + Click on the widget and selecting "Instance Options.” CSS Making changes to CSS outside of a widget will have minimal impact on your ability to upgrade. Same thing applies to your layout. With this in mind, don't be afraid to style and theme your portal to make it more attractive and "on brand." WRAPPING/EMBEDDING WIDGETS In some cases, you just need to augment or slightly modify the behavior of a widget. By embedding a standard widget in a custom one, you take advantage of the standard functionality while gaining the control you need. This is useful, for example, when you need finer control over the instance options that are passed to the standard widget or when you need to adapt URL parameters or events. DIRECTIVES From Angular.js documentation: “At a high level, directives are markers on a DOM element (such as an attribute, element name, comment or CSS class) that tell AngularJS's HTML compiler ($compile) to attach a specified behavior to that DOM element (e.g. via event listeners), or even to transform the DOM element and its children.” In simpler terms, a directive could allow you to attach behavior to DOM elements inside a widget you don’t “own.” This is an extremely powerful way to adapt widgets without cloning them. While diving into directive development is beyond the scope of this article, keep it in mind as you evaluate your options. IF YOU NEED TO CLONE In some situations, you can't always avoid cloning to achieve the result you want. If that is the case, be sure you: Document the cloned widgets Consider analysis time as part of your upgrade validation process After an upgrade, evaluate the source widgets to determine if you should Keep the clone "as-is" Upgrade it Revert back to the original Remember, Service Portal is a UI framework built to help you create great experiences. Don’t be afraid to deviate from the Stock theme and take full advantage of all its capabilities! ADDITIONAL READING For related information on the topic, check out these articles. Out-of-Box — Widget Library, ServicePortal Widget Cloning — Clone a Widget Modifying — Widget CSS, Embedding Widgets, Configure Widget Instance Options
The team at NewRocket recently collaborated with a major medical center in Southern California on their multi-department service portal. This non-profit hospital and multi-specialty academic health science center employs a staff of over 2,000 physicians and 10,000 employees. NewRocket proposed developing a single portal to facilitate a seamless user experience while still preserving individual department identities. “With a relentless, persona-based focus on the user experience, NewRocket ensured our Service Portal replacement solved our request inefficiencies while simultaneously being easier to use. Our developers, fulfillers, approvers and requesters love it!” Portal Features The portal features a user-centric design model that allows for quick access to ticket status as well as the ability to favorite content throughout the portal. The use of simple icons and contextual search creates an easy to use system for interacting with the IT & HR departments. The portal has been well received by both the employees and administrators. Multiple business units (IT, HR) Custom designed responsive theme Uses out-of-box widgets for core functionality Categorized typeahead search results My Account page Support for user delegates Favoriting of catalog items and articles Integrated live chat Take a look at the portal and let us know what you think in the comments below.
I'll be attending Now Summit in Santa Clara next week. If anyone is available and would like to talk Service Portal, I'm leaving some time slots open on my calendar. I'll be available in between and after sessions from Wednesday evening to Thursday at 5pm. Please click the button below to access my calendar. Looking forward to meeting you! Nathan Firth – Meet at Now Summit Santa Clara
By now, you've probably already used the Simple List widget. It is one of the default widgets on the OOB portal homepage. Similar to the Data Table widget, it is used to display a list of records from a table. However, there is a lot more to this widget than you might think. In this post, we will cover some of the secrets of the simple list widget. To give you a quick sample of its capabilities, there is an OOB demo page available at: https://yourinstance.service-now.com/sp?id=test_list Features Include: Display records from any table and filter Support for image fields Show primary and multiple secondary fields Limit the height with scrollable body Trigger an event Customizable actions To get started, let's first create a widget which shows the payload of the event that get's triggered when clicking a record. HTML: [crayon-5c6a02bbe3468406556938/] Client Script: [crayon-5c6a02bbe3470686160879/] Now if you place this widget on the same page as the Simple List widget, and if you don't specify a "Link to this page" in the Instance Options, you will see the JSON representing the record you clicked on. With this event, it'll be very easy to trigger a modal window or other user interaction, but for now let's proceed to adding some List Actions. LIST ACTIONS The Simple List widget supports adding additional actions for the records in the list. For some reason this related list is not visible on the form by default, so we'll need to add it: Pull up the Platform View of the Instance Record of the Simple List Click the hamburger icon > “Configure” > “Related Lists” Add "List Action -> Parent List" Now you should see the List Actions Related List When adding List Actions, you are able to include properties from the record in the URL field using double brackets: [crayon-5c6a02bbe3475936664404/] However, there are a couple of unfortunate limitations: You cannot link to an external URL You cannot use URL prefixes such as “mailto:” or “tel:” Clicking a List Action does not trigger an event This limits the List Actions to just linking to other pages, but hopefully this will get fixed in an upcoming release. DEMO Here is a quick video demonstrating how to configure some List Actions on the Simple List widget. FURTHER READING https://docs.servicenow.com/bundle/london-servicenow-platform/page/build/service-portal/concept/simple-list-widget.html
It’s a pretty common requirement to include images in your widgets, for example replacing the icons with images in the “Icon Link” widget (available here). However, if you have ever added an image field to one of the instance tables, you may have noticed that the images were not included in the update set. This obviously makes it difficult to migrate the portal between instances. The good news is there is a simple solution. SYNCING ATTACHMENTS First, go to a record within the table where you would like to sync attachments (e.g. sp_instance_link) Right click the heading > Configure > Dictionary Select the record where “Type” is “Collection” Click the “Advanced View” related link Paste the following into the Attributes field: [crayon-5c6a02bbe403f379713592/] When completed, it should look like this: Now, the next time you save or update the instance record, the image data will also get included in the update set. NOTE: If you wish to use the image field on all instance tables, you can create the field on the base “sp_instance” table. However, you will still need to follow the steps above for each one of the extension tables where the image field is used.
Learn how to streamline your stylesheets in Service Portal by utilizing the full power of SCSS. In this tutorial, I'll walk you through how to use CSS Variables in your widgets, so that they can be overridden in the Theme and Portal records. This is very useful when creating highly reusable widgets, themes or in situations where you have multiple portals sharing a theme. SCSS is a subset of the Syntactically Awesome StyleSheets (Sass) specification and is an extension of CSS. Every valid CSS stylesheet is valid SCSS. SCSS supports the following: Variables Variables are a way to store information that you want to reuse throughout your stylesheet. You can store things like colors, font stacks, or any CSS value you think you want to reuse. SCSS uses the $ symbol to make something a variable. Nesting SCSS lets you nest your CSS selectors in a way that follows the same visual hierarchy of your HTML. Operators SCSS has a handful of standard math operators like +, -, *, /, and %. Mixins A mixin lets you make groups of CSS declarations that you want to reuse throughout your site. You can pass in values to make your mixin more flexible. Functions SASS supports the use of functions by providing some keyword arguments, which are specified using normal CSS function syntax. Quick note: The order of CSS that is shown in the video is based on the Kingston release. In Jakarta, the Theme variables were loaded before the Portal variables. For further reading, check out the following resources: https://docs.servicenow.com/bundle/helsinki-servicenow-platform/page/build/service-portal/concept/scss-primer.html https://sass-lang.com/guide https://devhints.io/sass https://www.tutorialspoint.com/sass/index.htm
By now all of you should have noticed that you can request a personal developer instance of ServiceNow running the latest London release. Also with the new London release comes several new enhancements to the Service Portal. Here's a quick highlight of some of the new features: Faceted Search The Faceted Search widget replaces the Search Page widget and adds support for: Faceted Search Filters Pagination What's awesome: I love that the facets live as part of the search source so that we can customize the facets as well as add custom facets to our search sources What could be improved: The whole search page is a giant widget including the typeahead search and the breadcrumbs. This makes it difficult to customize. What if we have a theme without breadcrumbs? What if I want to move the search? Having the whole page be one giant widget is just not a good idea. It does not improve the typeahead results which is how the majority of users use the search Virtual Agent Enable your users to interact with a chatbot or live agent through various Virtual Agent interfaces. What's awesome: Nice modern interface Integrates nicely with Connect Chat What could be improved: It's not free (requires additional licensing) Takes a really long time to load Guided Tours Create a guided tour for a Service Portal page to guide users through the content step by step. What's awesome: Supports auto launch Supports (limited) HTML Easy to use designer interface What could be improved: No support for page overlays (darkens the page behind the dialog) Dialogs don't stay fixed when the user scrolls the page Automated Test Framework Write automated tests to validate Service Portal forms. What's awesome: We now have support for automated tests in Service Portal What could be improved: So far it's just limited to forms and service catalog Validation Scripts Validate user input in a specific field type using a validation script. My thoughts: As far as I can tell, this validates field types and not tied to a specific table, also would not affect catalog items or record producers... so honestly, I'm not really sure when this would be useful. If you know of some common use-cases, I'd love to hear them in the comments. For further reading, please see the official ServiceNow London Release Notes for Service Portal.