ServiceNow Application Development
Notifications with a weight of __ are always sent.
0
Script Include Creation Process
1. Create Class 2. Create prototype 3. Initialize function
Application Properties Creation Process
1. Create a System Property Category 2. Add Properties 3. Order Properties 4. Create Properties Module
Making a Glide Record Query
1. Create a glide record object for the target table var myObj =new GlideRecord ('table_name'); 2. Build the query conditions myObj.addQuery('category','=','hardware'); myObj.addQuery('priority','=',1); 3.Execute the query myObj.query(); 4) Process the returned data with Script logic 5) If updating records, do not forget to update: myObj.update();
Calling a Script Include
1. Create a new GlideAjax Object: var gaDesc = new GlideAjax 2. Pass Parameters, all parameters begin with Sysparm_ reserved parameter. Sysparm_name identifies the method: var gaDesc = new GlideAjax gaDesc.AddParam('sysparm_name','alertGreeting'); gaDesc.AddParam('sysparm_user_name','Ruth'); 3.Make the async call to the server 4.Callback function to process the returned data.
Process for Importing Data
1. Identify Data Source 2. Load Data 3. Review Import Set 4. Create Transform Map
Importing Data - High Level Process
1. Load Data - System Import Sets > Load Data 2. Create Table - Create table and provide a label 3. Choose excel file. 4. Submit 5. Create Transform Map 6. Transform
Maximum Notification size including attachments is __ MB.
26
Application Property
A configurable application parameter that can be used to pass values to scripts
Two Coalesce Fields - One Matches and the other does not
A new record is created.
REST Publisher
Accomplished by creating a new inbound web Service; publishes a web services that can be consumed by a third party.
Accessible From - Options
All Application Scopes This Application Scope Only
Application Artifacts
All of the "application files" comprising an application. Artifacts include but are not limited to: Access controls, business rules, script includes, tables, client scripts
Runtime Access Tracking
Allows administrators to manage script access to application resources be creating a list of script operations and targets that the system authorizes to run
Table - Allow Configuration
Allows other application scopes to write scripts for this table.
Table - "Allow Access to this table via web Services"
Allows web Service Access. Only available on tables that are accessible from "All application scopes"
Script Include Configuration Options
Application - Global or scoped. Whatever your target scope is. Accessible From - Two options: • This Application Only • All Application Scopes Client Callable - Makes it available to client scripts, list/report filters, reference qualifiers, or if specified as part of the URL.
Flow Designer Trigger Types
Application = Includes metricBase and Service Catalog Record - Created updated, created or updated Scheduled - daily, weekly, monthly, once, repeat
Flow Trigger Types
Application, Record, Scheduled
Script Intellectual Property Protection
Applies to UI Actions and Script includes. Applies when an application is installed from the store.
ACL - Table.None
Applies to a tables records, must have to view
ACL - Table.*
Applies to every field on a record where there is no field specific ACL
ACL - Table.Field
Applies to one field on a record
Application Module Link Types
Assessment Content Page Documentation Link Homepage HTML (from Arguments:) List Filter List of Records Map Page New Record Run a Report Script (from arguments:) Search Screen Separator Single Record Survey Timeline Page URL (from Arguments:)
Scheduled Script Execution
Automated piece of logic which executes at a specific time and / or on a recurring basis.
Annotations
Can be added using the form designer and include info boxes (both red and blue)
Virtual Agent
Can be used to automate IT Requests and Incidents. Good for less complicated scenarios.
Glide Form API
Client Side API that allows for the customization of forms. glide.form.js is the class containing the methods.
Glide User API
Client side API that provides access about the current user and their current roles; avoids the slower glideRecord queries to get this info.
Merge
Combining changes from different branches, or local vs remote changes
Fork
Copy of a repository under a new account (including branches)
Branch
Copy of an app's files under the same account
Studio Application Creation Option - Start From Scratch
Creates an empty application
REST API Explorer
Creates endpoints, methods, and variables used to send REST requests to the ServiceNow system.
Table - Application Access - Options
This Application Scope Only All Application Scopes
Override application menu roles
This option gives module-level access to a role that is not authorized to see the application. User must have the role specified in the module to view said module from the left nav menu.
UI Policy - Execute if false
This script block will only run if the "Reverse if False" option is selected.
Field Watcher
Tracks and displays information about actions ServiceNow performs on a form field.
Flow Anatomy
Trigger -Activity that initiates, can be record or time based Condition - Statement to determine when or how an action runs Action - Operation to be executed (Reusable) Executions - List of executions
Blank ACL Fields Evaluate to _____
True
Do not add custom fields to a base table.
True
True / False - Client Scripts can call server side Script Includes
True
Application Deployment Options
Update Sets, Application Repository
ACL - Easily Exclude fields
Use a Table.* ACL
Client Script Calls are Returned in the ___ format by default
XML
REST Consumer
accomplished by created a new Outbound REST message; invokes or consumes a a published web service.
Form Designer
add, modify, create, or delete fields, views, sections / tabs from a form.
Common Glide form Methods
addErrorMessage(''); - displays error at the top of the form addInfoMessage(''); - displays an info message at the top of the form clearMessages(); - clears all messages from the top of the form showErrorBox(); - shows an error box under the target field showFieldMsg(); - shows an informational message under a field, can be an error, info, or warning type. hideFieldMsg(); - removes field messages getValue() getReference(); setValue(); clearValue(); addoption(); clearOptions();
Form View
allows different users to see form data in different ways; works on fields, layout, scripts.
Table API
allows you to query, create, update, and delete a table's records. Table API is the default API in the REST API Explorer
Script Include Naming Convention
camelCase
Virtual Agent Plugin
com.glide.cs.chatbot
Integration Hub Plugin
com.glide.hub.integrations
Title-less Form Section
continues the previous section, allows you to combine multiple form layouts.
Studio Application Creation Option - Start from global
create a legacy global application
Common Glide System Debug Methods
debug() error() info() warn() isDebugging()
UI Policy
defines the behavior and visibility of fields on a form; options are mandatory, visible, and read only
Transform Map
determines the relationships between fields in an import set and fields on an existing table.
Syntax Editor hotkey - Control + Spacebar
displays a list of valid elements at the cursor's current position.
ACL - Easily Include fields
do NOT use a Table.* ACL
Flow designer ______ support the use of subflows
does
REST API Explorer Stub Code
does not extract info from the web service response. Developers will have to write the code for processing the response.
True / False - You can only have one Coalesce field
false
Number of ACL's created with a new table
four
the global object ______ is used to access glide form methods.
g_form
the global object ______ is used to access glide user methods.
g_user
Common Glide System Object / Table Methods
getProperty() getPreference() getDisplayColumn() tableExists() nil() eventQueue() print() log() logError() getMessage()
Common Glide System User Object Methods
getUser(); getUserName(); - Returns the user name or User ID getUserID(); - Returns the sys ID getUserDisplayName(); - Returns the display name hasRole();; hasRoleInGroup();
setSectionDisplay
glide form method for showing or hiding an entire form section
the global object ______ is used to access glide system methods.
gs.
Script to Fire an Event
gs.eventQueue("event_name",current,myString1,gs.getUserName());
Common Glide User Methods
hasRole hasRoles hasRoleExactly userID - Returns the sysID
Notifications with the _____ ____ ____ are given priority and sent.
highest weight value
Inbound Email - Sender is blocked / Locked out
inbound email actions fail
Unauthorized Script Access
is skipped in ServiceNow and is controlled by Application Access settings. Set on a table by table basis
Document Feeds
live feed group that is associated with a record, such as an incident or change
Application Repository Requirements
must have a valid subscription, matching application scope, and network access.
Document Feed Configuration Roles
personalize_dictionary or admin
Studio Application Creation Option - Create a custom application
start with a table, menu, and simple access controls.
Glide Record
used for database operations instead of writing SQL queries
JavaScript Reserved Word
words that are not able to be set as a variable within a JavaScript script. For Example, class, default, switch, return.
Field Watch Logs Activity When
Default Value is Set Access rights change due to an ACL or Dictionary Setting Data Policy Reference Qualifier UI Policy Field value changes due to various types of scrips
Application Scope
Determines which application artifacts are available to other parts of Service Now
Outbound Emails can be Triggered when an ____ __ ____ or when a _____ __ ______ __ ______.
Event is fired, Record is Inserted or Updated.
Integration Hub
Expands flow designer to provide low t o no code integrations with third party apps
ServiceNow Studio Does Not Allow for
Form Layout Previous number check Push to update set Testing of the application Script intellectual property protection Ability to merge branches Ability to add data
Syntax Editor Coloring
Green - Comments Purple - JavaScript command Blue - Strings or reserved words
Debugging Colors
Green / Blue checkmark - Pass Red - Failure Grey - Skipped
Form Designer Anatomy
Header Field Navigator Form Layout
Studio Anatomy
Header - Displays menus and controls, file menu, source control menu, create app file menu Application Explorer - Displays a list of application files by type Content Frame - Displays each record in its own tab Status Bar - Displays info about the app and source control integration
ServiceNow Studio
IDE-Like interface to build custom applications, create or modify application files, and work in a tabbed environment.
ServiceNow supports both ______ and ______ web services.
Inbound (provider), outbound (consumer)
REST HTTP Status 200
Indicates the post was successful. Does not mean you are receiving expected results.
Flow Action Designer Consists of
Inputs - values passed into the action Steps - sequential units of logic Outputs - Data resulting from the finished action, can pass data to actions in the same flow
Flow Actions are Made up of
Inputs, steps, outputs
Studio Application Creation Option - Start from a Service
Keep original service in production and develop your new application to replace it when you are ready
Syntax Editor - Period after Class name
Lists methods available for the class you are currently using.
Syntax Editor - Open Parenthesis after valid class, function or method
Lists the expected parameters to assist with script writing.
Stash
Locally stored set of all local changes, used to move changes between branches
Coalesce
Makes a field a record's unique key. If a field is matched against this the record will be updated.
Client Scripts
Manage the behavior of forms, fields, and lists in real time. Allows for the showing and hiding of fields, modifying choice options, or making things mandatory.
Access control search order goes from ______ to ______
Most specific, most generic
Scheduled Script Executions are _____ triggered by actions taken by users or by modifications to records
Never
ACL - If access is denied to a row
No field level rules can grant access
Script Intellectual Property Options
None - Anyone who installs your app can view and modify the script on the instance. Select this to allow other devs to customize the script Read Only - Allows anyone who installs your app to view your script, other developers can read but not edit your script Protected - Prevents anyone who installs your app from viewing or modifying the script; prevents other devs from seeing or modifying your script.
Runtime Access Tracking Options
None - Application scripts can access resources from other applications as long as the table-level access settings allow it. Tracking - The system runs the tracked operation as long as the table-level access settings allow it. Enforcing - The system blocks the tracked operation from running until an Administrator manually changes the status to Allowed and the table-level access settings allow it.
Form Mobile View
Only has one column. Sections with two columns will only display one on the mobile view.
Develop a custom application
Only if you are solving a business problem.
Mapping Assist Utility
Provides a visually intuitive environment for specifying mapping between import set fields and production table fields. Allows for drag and drop configuration.
Table - Application Access
Provides runtime protection from application tables against read, write, create, and delete operations from scripts and web services.
DO NOT practice using the ____ ___ ________ on the production instance.
REST API Explorer
Glide System API
Service Side API that provides a number of convenient methods to get info about the system, logged in user, etc.
ServiceNow JavaScript Engine
ServiceNow uses the ECMA Script 5 standard based upon Rhino Version 1.7 R5
Auto Mapping Utility
Simplest method for mapping; matches field names of the import set with fields on the target table. Found on the related list of the transform map.
Script includes
Store JavaScript functions and classes for use by server-side script objects. Defines either a function or an implementation of a ServiceNow class. Only run when called by a script. Often used to enable different components to reuse server code and to make server code available to client-side calls.
Inbound Email - Sender Does Not Match Existing User
System impersonates the guest user to complete inbound email actions
Inbound Email - Sender Matches Existing User
System impersonates the user to complete the inbound email actions
ServiceNow Studio Allows for
Tabbed environment Code search Quick creation of scripts and files Push Global application files management
Client Script Configuration Options
Table - specifies the table the form or list is related to. UI Type - Desktop Only, Mobile / Service Portal, All Type - When to run, options include onChange, onLoad, OnCellEdit, onSubmit
ACL - If access to a row is allowed but the field is denied
The field is not visible
ACL - If access to a row is allowed and access to a field is allowed
The field is visible