Global Utility

Unifi has some functionality that requires access to methods not available to scoped applications. We grant Unifi access to those methods through a single global utility Script Include which you can install via Update Set.

With version 4.0, the Update Set also includes a queue processing job Unifi dataset events process which is necessary for Datasets to be processed.

It is strongly advised that you install this utility to get the most out of Unifi.

  1. Download Unifi Global Utility.

  2. Import the file as an update set, then preview and commit it. You can find more information on how to Load customizations from a single XML file in the ServiceNow Product Documentation.

Dependent Features

Execute Now

Method: snd_eb_util.executeNow(job)

This is necessary for Datasets to execute their associated ServiceNow Import Job.

Get SOAP Response Element

Method: snd_eb_util.getSoapResponseElement(xml)

When working with Scripted SOAP Services, it’s important to be able to set the soapResponseElement directly in order to preserve the exact payload to be sent back to the calling system. This can only be done with the Global Utility.

Moving Attachments

Method: snd_eb_util.moveAttachments(attachment_ids, record)

The ServiceNow scoped attachment API does not support moving attachments from one record to another. This is necessary for inbound attachments which initially reside on the HTTP Request and are then moved to the Target record.

Run As User

Method: snd_eb_util.runAsUser(user, fn)

On occasion, Unifi needs to run some code as the given user. This is necessary things like replaying requests.

Jelly Processing

Method: snd_eb_util.runJelly(jelly_code, vars)

Jelly processing is not supported in the ServiceNow scoped API’s, however it is very useful for XML processing. Use of the Global Utility drastically improves XML payload capabilities if you are working with XML payloads.

Script Validation

Method: snd_eb_util.validateScript(script, scope)

Used by the Unifi Integration Diagnostic to check scripts for errors.

Binary Attachment Handling

Method: snd_eb_util.writeAttachment(record, filename, content_type, data)

The Scoped Attachment API does not support writing binary attachments which can cause problems when receiving things like Word documents or PDF’s. This method allows Unifi to use the global attachment API to write those files to the database meaning they will work properly.

Update Set Packaging

Method: snd_eb_util.packager.*

The packager methods included in the global utility allow Unifi to automatically export all the components of an integration in one easy step. The packager methods will allow Unifi to create an update set for the integration, add all the configuration records to that update set, and export it as a file download from the Integration page on the Unifi Integration Designer portal.

Web Service Creation

Method: snd_eb_util.web_service.*

The web service methods included in the global utility allow Unifi to automatically create and update REST Methods used by Unifi integrations.

Trigger Rule Creation

Method: snd_eb_util.trigger_rule.*

The trigger methods included in the global utility allow Unifi to automatically create a Trigger Business Rule on a table if one doesn't already exist.

Dataset Create Data Source

Method: snd_eb_util.datasetCreateDataSource(dataset, attachment)

Create a data source for datasets to use when importing data.

Dataset Delete Scheduled Import

Method: snd_eb_util.datasetDeleteScheduledImport(scheduled_import_id)

Delete a scheduled import that belongs to and was created by a Dataset. Used when deleting a Dataset.

Dataset Delete Transform Map

Method: snd_eb_util.datasetDeleteTransformMap(transform_map_id)

Delete a transform map that belongs to and was created by a Dataset. Used when deleting a Dataset.

Dataset Ensure Transform Map

Method: snd_eb_util.datasetEnsureTransformMap(dataset)

Update a transform map for a Dataset to use when importing data. Used when building a Dataset.

Dataset Update Transform Map Fields

Method: snd_eb_util.datasetUpdateTransformMapFields(dataset)

Update the coalesce fields for a transform map. Used when building a Dataset.

Last updated