ServiceNow Scripted REST APIs & Retrieving Catalog Item Variables

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

Update Set Collision Avoidance Tool: V2

In a previous article: Detect Update Set Collisions Before They Happen, we made a tool freely available, which would help to prevent developers from accidentally overriding or colliding with each other's update sets, or otherwise having issues caused by conflicts or improperly selected update sets. 

Since publishing that article, we've gone through multiple version iterations, and we've recently released the official Version 2
Version 2 is available from this link, as is the documentation. 

Feel free to click below, to read more.

Read More

ServiceNow: What's New in Geneva & UI16 (Pt. 2)

In this article, we're going to talk about some of the updates that were made to the "Part 1" article shortly after publishing it, list out some of the more technical changes in Geneva, as well as answer some of the most common questions that our clients and reads have had for us.

First, let's jump straight to the Q&A section, which includes new info on how to more fully customize the UI16 interface and work around some of the new features to restore original functionality or customize the new functionality. Click below to read on! 

Note: This is part 2 of a 2-part series of posts on ServiceNow's Geneva version, and the updated UI16 that comes along with it. Please read Part 1 first, or you might lack context for some of the things we discuss.
Read More

Understanding Attachments in ServiceNow

Attachments in ServiceNow are not so straight-forward as email attachments, and it's not always obvious how to do what you want with them. Recently, I had a need to copy some attachments programmatically and otherwise fiddle around with attachments. 

After finding nothing in the ServiceNow product documentation, nothing on the wiki, and very little through the usual search channels, I figured it was time to write an article about how to programmatically deal with attachments in ServiceNow. 

In this article, we'll learn how attachments really work in ServiceNow, how we can manipulate, copy, and even generate hashes for them (sometimes)! 

Read More

Reference Field Auto-Complete Attributes

If you've ever used a reference field, you've probably seen that when you start typing, an auto-complete drop-down appears, to help you out. The info that appears in this auto-complete drop-down, is usually the display value for a given table (that is, the field which has the display property set to true). 

There are many cases where you may want more information than that. Maybe you've got many records with similar (or even identical) display values/names. Maybe you're referencing the user table, and want to make sure you don't select the wrong "John Smith". 

Read on to learn more! 

Read More

GlideRecord & GlideAjax: Client-Side Vs. Server-Side

It is easy to shoot yourself in the foot when it comes to performance, using client side scripts. For this reason, it is generally good practice to move any complex processing, large requests (more than a hundred or so records), and multi-level dot-walking to server-side scripts such as business rules which can present the data to the client. This can be done in a few ways, such as by using GlideAjax. It's also a good idea to utilize callback functions in almost every case where you're doing record lookups client-side. 

In this article, we'll go over some of the best ways to get the greatest client-side performance out of ServiceNow, by using good coding practices, callback functions, and GlideAjax to push some of the work off onto the server, rather than the client and prevent the client from having to wait around for the server to respond. 

Read More

Make Your Log Entries Easier to Find

Like most developers, I write a lot of code. 
Like all developers, sometimes my code doesn't work. 
When that happens (server-side), I rely on gs.log() to spit out some information to tell me when, where, and maybe even how the error happened. 

gs.log() is an extremely useful little function that is great for troubleshooting your code in dev, as well as catching unexpected behavior or circumstances in production. 
For example, you might have your code run inside a try { } block, but have the following catch() { } log the error message and accompanying run-time technical details using gs.log(). 
Or, you might write your code so that if a function receives some unexpected data, a log entry is created with the details, while the user is informed using gs.addErrorMessage(). 

The problem is that whenever I make one of these logs, I find myself sifting through tens, hundreds, or even thousands of other log entries to find just the one that my code triggered - and of those, just the one that was triggered by the most recent execution of my code. 
What's even worse, is if a user has to let me know about a bug or error they got, but they can only tell me that it happened "around Thursday". How am I supposed to find that log!? 

Join me after the jump, and not only will I teach you how to do it, but I'll give you a file you can deploy in your instance to enable this functionality within minutes! 

Read More