Skip to main content

Posts

Showing posts from October, 2018

Events

There are two ways to generate events: Server-side script using the gs.eventQueue() method Workflow Create Event activity gs.eventQueue() Method The eventQueue() method is part of the GlideSystem server-side API. The eventQueue() method inserts an event in an event queue. The eventQueue() method is typically passed four parameters but can also take an optional 5th parameter: Event name. Enclose the event name in quotes. GlideRecord object, typically current but can be any GlideRecord object from the event's table. Any value that resolves to a string. This is known as parm1 (Parameter 1). Can be a string, variable that resolves to a string, or method that resolves to a string. Any value that resolves to a string. This is known as parm2 (Parameter 2). Can be a string, variable that resolves to a string, or method that resolves to a string. (Optional) Name of the queue to manage the event. DEVELOPER TIP : Use gs.getUserName() and gs.getUserID() for parm1 and p...

GlideSystem hoursAgo() method

When passed a positive number, the method looks into the past. When passed a negative number, the method looks into the future. It may seem counterintuitive for a negative number to reference the future. The method is hoursAgo(), which is why positive numbers are in the past. Two hours ago is a positive number.

Scheduled Jobs

To run a Scheduled Script Execution on the last day of the month, configure a monthly Scheduled Script Execution set to run on day 31. The Scheduled Script Execution will run on the last day of the month, even for months with fewer than 31 days. On Demand Scheduled Script Executions run when an administrator clicks the Execute Now button. Scheduled Script Executions have two scripting fields: Condition Run this script

Data Sources

Data sources define what data should be imported. Only admin users can create data sources. In this module, the data source is a Microsoft Excel spreadsheet. Other possible data sources are: CSV JDBC FTP HTTP XML Data is not imported directly from a Data Source into the target table. The steps are: Load Data into a staging table Create Transform Map Run Transform to move data from the staging table to the target table Check data integrity While transforming, 1)  Do not use the string NULL in source data or in a script. NULL is a reserved word. Null and null can be used but not NULL. 2)  Field Maps take precedence over Transform Map scripts. 3)  Use the coalesce option in a Transform Map Field Map to determine if a row in the source data matches a record in the target table. The coalesce option makes a field a record's unique key. Set the coalesce value to true to use a field to check for collisions. Transformation Script: Transform...

SNOW Data Import Prerequisites

Before importing data into ServiceNow, it is recommended you take the time to: Understand what data you are bringing in Create a plan to map the source file columns to the target table columns Decide what to do with incomplete or erroneous data It is much harder to remove unwanted data than it is to create a plan in advance.

SNOW Cross-scope access Applications

Use Runtime Access Tracking to manage script access to resources from other applications. This is known as cross-scope access because the records are in different application scopes. None : No authorization required for application scripts to access resources from other applications as long as the other application allows it. No record in the cross-scope access table. Tracking : Allows application scripts to access resources from other applications. A record for the access is automatically inserted in the cross-scope access table with a Status value of Allowed. This is the default setting. Enforcing : Allows application scripts to access resources from other applications only after an admin authorizes the access. A record is automatically added to the cross-scope access table with a Status value of Requested. The cross-scope privileges must be set before applications are installed on other instances. While applications are under development, be sure to test all script logic t...