Script examples

The advanced server-side techniques we have seen can be used in a number of ways, and you will find advanced server-side scripting to be some of the most common in the ServiceNow platform.

Now that we have seen where to write our advanced server-side code, we can have a look at some further examples to solidify our understanding.

Let's have a look at a script include example first. We will write a script to return the active tasks of a requested item. This can be helpful for letting users know which tasks need to be completed for an item to be fulfilled.

First we will take a look at the script include code:

var item_utils = Class.create();item_utils.prototype = {    initialize: function() {    },   getActiveTasks: function getActiveTasks(item) ...

Get Mastering ServiceNow Scripting now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.