Pro Tip: Use updateMultiple() for Maximum Efficiency!

Although most of our free time has been spent focusing on writing the Learning ServiceNow book, we wanted to post a quick Pro-Tip to address an issue we've seen impact performance on nearly every instance we've worked on: The use of loops to update a single field on a large number of records in the database. 

Let's say you've got a client who wants to run a scheduled job that'll auto-close Incidents in "In Progress" status, that haven't been updated for 30 days, by setting their state to a custom value, "stale" (or, since State is an integer field, 10). Let's see what a script for that purpose might look like, as it's usually written...

Click below to read more! 

Read more

We're Writing a Book!

You may have noticed that we haven't posted a whole lot in the last few weeks. This is because I (Tim Woodruff, Owner/Founder of SN Pro Tips & The SN Guys) write the majority of the articles that show up here, and I've been directing my writing efforts elsewhere recently... 

We're Writing a Book! 

That's right, in case the title of this post didn't ruin the surprise, we are writing a book on ServiceNow Development and Administration in partnership with Packt Publishing, which has just been announced. This book is called "Learning ServiceNow" (ISBN 9781785883323), and it is geared toward the zero-to-medium-experience ServiceNow developer, and is meant to serve as both a complete guide to getting started with ServiceNow development and administration, as well as a knowledge-boost for any newer developers (say, devs with less than a couple of years of experience). 

I also intend to include a "pocket reference" type of document with some of the best Pro Tips you'll find in the book, as well as from this site! 

I just wanted to make sure our readers don't get the idea that we're going anywhere since we haven't released an article in a while. Once this book is published, we'll have some great new content coming your way, including some features from the book if we can! In the meanwhile, we hope to post a few quick Pro Tips here and there, but we hope you'll subscribe to stay tuned for our bigger, deep-tech articles, several of which we've already got lined up on the back-burner, including: 

  • The best way to perform a query in a nested loop
  • Creating a unique/one-to-one relationship in ServiceNow
  • A debugging series, including:
    • How to debug field visibility/mandatory/read-only state
    • client-side, and server-side javascript errors. 

In the meanwhile, feel free to check out our archive to review some of our other articles. As always, don't hesitate to contact us if you have a question or want to discuss how we can help your business with any ServiceNow-related needs. Thanks for reading! 


SN Pro Tips is owned and written by The SN Guys, ServiceNow consultants. If your organization could benefit from our services, we humbly welcome you to schedule some time to chat and share your goals with us, so we can help your business Grow With Purpose


Chrome Extension: Load in ServiceNow Frame

Over a year ago, when I first launched this website, I posted some free versions of my earliest tools. One of the first little tools I posted, was the SN Frame bookmarklet. As with all tools on this site, we put it out there for free and without any advertising or other nasty stuff. Today, we've just released the latest version of this tool as a Google Chrome Extension. Read on for more info, or click that link to download the tool from the Chrome extension store. Alternatively, you can search for SN Framerizer on the Chrome extension store

I often find myself middle-clicking a link or otherwise opening links in ServiceNow in a "new tab" or "new window". This means that I often get pages that load just the content frame, without the ServiceNow frame...

Click below to read more! 

Read more

Force-Include Any Record Into an Update Set

While most of the records in ServiceNow that you might want to track in an update set are already tracked, due to a dictionary attribute called update_synch, you might just be surprised at how many types of records are not tracked in update sets! For example, scheduled jobs and scheduled script executions are not tracked in update sets, so you either need a tool like this, or you'll need to move these records over manually! Skip to the bottom of this record for a link to the download page. 

Since manual work is for Peons from Warcraft III and not for developers, let's build a better solution while we laugh at the mere mortals that export-then-import their records as XML. 

Read more

GlideRecord Pagination - Page through your GlideRecord query

Perhaps you've got an exceptionally long query you'd like to run. 
Perhaps you need to gobble up large amounts of data via scripted REST API.
Or, perhaps you're building a neat little UI to display an arbitrary number of records. 
here are a dozen reasons why you might want to "page" through a list of records in a script, but unfortunately there hasn't been a good way to accomplish this. There are nigh-undocumented APIs like "saveLocation()", but they don't tend to work consistently, or quite accomplish our goal of pagination. 

Instead, we've decided to write our own GlideRecord page-turning utility, and make it freely available here along with our other free tools. Read on for more info! 

Pro TipIf you haven't checked out our other tools yet, hover your mouse over the Tools option at the top of this page. You'll find highly useful and FREE tools, such as the Update Set Collision Avoidance Tool, the Better One-Click Approvals Tool, the Update Relocator Tool, and the Temporary Permissions Utility
Read more

Granting Temporary Roles/Groups in ServiceNow

In today's article, we're going to build some new functionality around granting temporary permissions. This will give us the ability to grant users temporary permissions by either directly granting a role, or by adding them to a group temporarily from a user's profile. 

We're also going to create the ability to bulk-add users, temporarily, to a given group. This could be an assignment group, or a security/permissions group. It could also be a group created specifically for temporarily granting a specific subset of roles. 

We're also going to allow an Administrator to set a specific expiration date for these temporary permissions. 

Finally, for security purposes, we're going to make it so that users who have temporary versions of the higher permissions roles (admin/security_admin) cannot add the admin or security_admin roles (temporary or permanent) to themselves or other users. 

So now that our project requirements are laid out before us, let's begin! 

Note: If you're feeling super lazy and just want to download an update set containing this functionality so you can deploy it into your instance already, scroll to the bottom of the article for a link to the Tools page, or find the Grant Temporary Permissions tool under the Tools section in the nav-bar at the top of this page! 
Read more

Scripted REST APIs & Retrieving RITM Variables via SRAPI

In Fuji and prior releases, ServiceNow has supported the REST API, but they've only supported simple table and record APIs using GET, PUT, POST, PATCH, and so on. In Geneva however, ServiceNow introduced Scripted REST Apis.

Scripted REST APIs allow a developer to create a custom REST API Resource, receive request arguments via a REST call, and return data (as with GET requests), create a record (as with POST requests), update records (as withPUT/PATCH requests), or delete records (using a - you guessed it - DELETE request) using custom code that can utilize REST headersquery parameters, and/or request body elements

Scripted REST APIs have only become available fairly recently (in the Geneva release of ServiceNow), and are something that a lot of developers have been avoiding, as they're new and arcane, and the documentation around them is still fairly new, and not very well built-out.
In this article, we're going to learn how to create our own custom scripted REST API, which we'll use for our demo project: Retrieving the service catalog variables associated with a given RITM, for reporting in an external system. 

Read more

What's New in Helsinki?

It seems like only yesterday that we upgraded to Geneva... Maybe that's because many ServiceNow customers still haven't done so. That won't stop us from exploring the new hotness that is Helsinki, though! As always we aim to provide you with the latest updates on the latest update. 

Get it? That was a terrible pun. I apologize. 

We've scoured the existing documentation, watched the available demos, and tried out the early-access dev instances. In this article, we're going to cover all of the most visible changes and new features in Helsinki so far on a product-by-product basis, and give you the low-down on what you can expect out of an upgrade. Let's get started! 

Note: This is part one of a two-part series on ServiceNow HelsinkiSubscribe to stay tuned for when part 2 comes out! 
Read more

Customizing UI16 Through CSS and System Properties

When you've got two UI versions included in your instance (such as with Geneva, having UI15 and UI16), customizing the user interface can become somewhat complicated. You could spend hours modifying a theme, or modifying the default UI, only to find that that doesn't modify UI16 at all, and there's no real way to tell. 

In this article, I'm going to guide you through modifying every little bit of UI16's theme. I'll also show you how to make a custom theme that users can select, and modify the UI16 UI to include your company's branding, logo, and slogan. 

Read more

ServiceNow Versions: Express Vs. Enterprise

In November of 2014, ServiceNow announced that it was launching a trimmed-down, simpler version of its' ITSM platform. The "light" version would be called Express, and they've dubbed the more full-featured edition Enterprise. But what is the difference between "ServiceNow" (Enterprise) and "ServiceNow Express"? 

ServiceNow Express is significantly less expensive than its' big brother, Enterprise; and for many companies, it is an entirely viable solution for their ITSM needs. It is however, not for everyone. ServiceNow has designed Express to appeal to businesses with fewer than 1,000 employees, who are willing and able to adopt "mostly out-of-box" ITIL processes without the need for much customization, whereas Enterprise is meant to be a "There's almost nothing it can't do" sort of tool that will bend to fit your processes and even automate them to a level that can entirely eliminate the need for some full-time staff. 

In this article, we're going to go over some of the core functionality offered in ServiceNow Express, and point out those areas and functionality which are lacking. We'll also discuss upgradeability, and some examples and tips for determining which ServiceNow option might best suit your business needs.

Read more