Script examples

In this chapter, we have seen how to script in Jelly and how to create a UI page ourselves. Let's bring these two abilities together to make a working UI macro.

This is an example of a request I have been asked for before – an approval summary on the group approval record. Here, we need to create a UI macro and a formatter to add to the group approval form.

Let's start with our group approval summarizer code, creating a brief summary of the task record we will be approving with our group approval:

<?xml version="1.0" encoding="utf-8" ?><j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">  <tr>    <td class="label_left" width="100%"> <label style="margin-left: 12px"> Summary of Record ...

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

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.