Adding ‘Save As Draft’ Functionality

Update: apologies but I wrote this article while clearly very tired and it doesn’t read very well! But the general gist of the functionality is there so I won’t update it, but I’ll take better care in future 🙂

This requirement has come up enough now for me to share my implementation of it on here for others.

So this requirement usually comes from the change management team when delivering change.

Change forms are generally quite long with loads of fields and options to select from, despite doing my utmost to shorten and simplify them!

In the old days of word documents and spreadsheets, an employee could download the change form and over the course of a few days, gather the right information and fill it out and submit it when they’re ready.

In ServiceNow, you generally don’t have that luxury with mandatory fields. You either submit when they’re all populated, or you don’t.

That’s where the ‘Save as draft’ option comes in.
Continue reading

Enhancing The Impersonate Functionality

Update: This has now been added OOB to Geneva to the elevate privilege dialog, but not for the impersonate dialog


When building security rules, I find myself impersonating back and forward constantly between numerous users trying to test what a user can see or do.

What gets to me is that every time I impersonate, it throws me to the homepage and then I had to navigate again to the correct location I was testing.

You could of course open multiple windows and impersonate in the other one, but things eventually get confusing.

Instead, what I added was the ability to stay on your current page by adding a new checkbox to the impersonation page:

Screen Shot 2015-07-27 at 15.39.29

Continue reading

Automated Login Using A HTA File

One of our clients had the concept of kiosks in particular locations/office/factories. These kiosks were used to give users access to a number of applications for information. One of the things they wanted the kiosk to have access to was their ServiceNow knowledge base.

We didn’t want to make the knowledge base public because it contained sensitive information, and at the same time didn’t want the users to have to enter a username and password to login.

I experimented with a login using a HTA file (same technology as Help the help desk functionality). The idea being that this could sit on the desktop and when clicked, will login automatically to ServiceNow.

We never used this solution, but I thought the idea was interesting and one I haven’t played with before so posting it here just as a concept.

So the approach was this (actual code at the end):

I created a new user record specific for each kiosk. The username was the windows username that the kiosk was logged in with. On the user table, we created 2 new fields:

1) u_ip which IP restricted who could access using this account

2) u_automated_login which was a True/False field to determine if this user record could use automated login or not

Then I created a HTA file which would read the username of the logged in user. Then it would do a HTTP post which was the same as the page, except it would also pass an additional parameter across with it of ‘AutomatedLogin’.

Editing the Login installation exit, I then would check if the additional parameter was passed through, if so, I would check if this user had the Automated Login checkbox ticked, and finally, would check if their IP address matched against the one on record. If all these passed, I would log the user in automatically.

Continue reading

[Updated x2] Enabling Instant Chat Notifications (Chat Queues, Groups And Private)

Update 2 – ServiceNow demoed a new version of this chat functionality coming in Geneva version. Looking forward to this!

Update from ServiceNow – This is NOT recommended and is hidden as it is not scalable in large environments. Shame as this functionality looks awesome! It has my vote for a permanent feature in future 🙂

The chat plugin in ServiceNow is very good and extremely useful if used correctly.
It allows for instant messages to be sent through to colleagues or customers for quicker resolution.

The biggest drawback however that I’ve heard is that it’s not immediately obvious that someone has messaged you unless you’re in the chat window itself.

We looked at a number of options such as polling the server every minute to look for new chat messages to post alerts and creating new formatters but after some digging, we found a very very easy answer. And what’s better? It’s out of the box provided by ServiceNow! Hit after the break for a video of what it looks like and more importantly, how to enable it.

Continue reading

Making Better Catalog UI Macros

Many of us would have played around with UI Macros before. They’re a very useful part of the system and they allow for all manners of customisations to the tool. This post is focussed on UI Macros on catalog items as this is where I generally use them the most, to make form submission easier.

One thing that you probably would have noticed is that you can’t use standard g_form methods on the UI macro to hide it, make it mandatory etc. nor can you use UI Policies. You can create custom client scripts to find the elements and hide/show them etc but this can be a bit annoying so I dug a little deeper to understand why and how to get them working. Low and behold, I found a VERY easy way to get them working!

Continue reading

Generate Printable QR Codes From Assets

ServiceNow continues proving to us what a great tool it is for managing your IT assets. And now ServiceNow are really making excellent strides in the mobile phone UI and the tablet UI. So I wanted to put the two together.

What I came up with was a simple way of generating QR codes for assets which could be printed and stuck onto the assets. When scanned by a desktop engineer out on site, ServiceNow will automatically load into the relevant window, speeding up the need to go into ServiceNow and search. This allows your engineers to spend longer working, and less time faffing around on the system.

Continue reading