TOTP (Time based One Time Password)

General No Comments »

Make use of one-time passwords for several two-factor authentication systems.
Continue reading…»

Howto: Manage e-mail hyperlink to ServiceNow with a portal

General 1 Comment »

The portal

You have created a beautiful portal in ServiceNow using CMS where your end users can log in, search for support, create tickets, chat with a service desk and keep track of their logged incidents or change requests. (BTW: If you want a nice portal please contact us, we can build great portals for you 😉 )

The problem we faced

If you send out an email notification when the user submits an incident or change request or there is an update on a ticket, you’d like to send a hyperlink in the email message. Now the user is able to quickly navigate to the ticket on the ServiceNow instance.

By default ServiceNow sends a URL to

This will result in the behavior that the user will be directed to the ServiceNow instance and not the portal.

The (almost perfect) solution

Continue reading…»

Cool Twitter feed on your ServiceNow homepage

General 1 Comment »

In this blog I will show you how to create a cool Twitter widget for on your ServiceNow homepage.
I want the Twitter widget to save all the tweets into a custom table. This because the Twitter RSS feed API will only return the tweets from a few days in the past.
Also the Twitter widget needs to be maintainable from a preferences screen, therefore I will create some preferences in the System Properties (sys_properties)
The user must be able to fill in an search query for the tweets, the maximum results that must be showed in the widget and the maximum age of a tweet.
I will use the Google API to read out the RSS from Twitter.

We will walk through the following steps for this cool widget:

  • Create a custom table
  • Create the form and table fields
  • Create the System preference variables
  • Create a System property category for our preferences screen
  • Create a Script Include that can parse XML records for our UI Page
  • Create UI Script to load the Google API
  • Create UI Page to build our HTML with the Twitter feeds
  • Make a new widget for showing our Twitter Widget
  • Place the widget on the homepage

Create custom table

Create a table with the label “Twitter Widget”, check “Create new application” with name “Twitter Widget” and create a new module in the new application, see picture above.

Navigate to the new created application, open the form view and edit the Form layout.
Continue reading…»

Prefill form without insert, URL encode and optional use Tiny URL

General No Comments »

Sometimes you don’t want to create a record but you need to prefill some fields on the form.
You can do this by creating a “dynamic” URL, like this for example in an UI Action (Button) to copy a change task:

[cc lang=”javascript”]
var link = ‘/’ + current.cmdb_ci;
link += ‘^priority=’ + current.priority;
link += ‘^change_request=’ + current.change_request;
link += ‘^company=’ +;
link += ‘^risk=’ + current.risk;
link += ‘^impact=’ + current.impact;
link += ‘^urgency=’ + current.urgency;
link += ‘^assignment_group=’ + current.assignment_group;
link += ‘^short_description=’ + escape(current.short_description);
link += ‘^description=’ + escape(current.description);

gs.addInfoMessage(“New change task created as a copy of change task ” + current.number);

In the script above we will create a link where we redirect the user to.

We use the Javascript function “escape” to encode the value for use in a URL, this prevents errors in the URL with the use of &, ?, ‘ and = signs
(I first used but when it’s not needed don’t use Packages)

Optional we can enable the Tiny URL plugin
This will keep the URL tiny and the URL can be as large as we want. When the plugin is enabled the URL will become:
[cc lang=”text” nowrap=”0″]
instead of:
[cc lang=”text” nowrap=”0″]^priority=3^

When we look in the Tiny URL table (sys_tiny_url) we will find our record with the following data:
[cc lang=”text” nowrap=”0″]
The Tiny URL will be used when the length of the property glide.tiny_url_min_length is exceeded. (default 1024)

If you have any questions you can contact me using mail on

Client Script for multiple fields

General 5 Comments »

Imagine you have a form – say for example the incident form.

And the impact is depended on the selected values from the “Urgency” and the “Category” field.
For example we define these rules for the fields on the form

Urgency Category Impact
1-High Database 1-High
2-Medium Software 2-Medium
3-Low Hardware 3-Low

Continue reading…»

Handling variable coalesce in transform maps

General No Comments »

Sometimes a functional request might look difficult, but after taking a closer look the solution can be easy….

When creating a transform map for importing records in a target table, you can set the coalesce on one or more field maps. This way you can find the corresponding target record.

The wiki of describes this on

Our customer asked us to create a Transform Map where the unique key is not always on the same field maps. So for example if you are creating a transform map for importing users into the sys_user table, you must be able to define the correct user record on the AD account ór employee number.

The problem

If you do it the normal way, you would set the coalesce on 2 field maps (AD account and employee number) however, when the source record has an incorrect value for the employee number and a correct value for the AD account, the result will be an “insert action” for this user since the target record isn’t found.

We have found a simple and effective solution.
Continue reading…»