Package Enhancements for Testing Flashcards
ServiceNow has over 30 places where code can be inserted to change the behavior of the platform. Some are:
- UI/Data Policies, UI Actions
- Business Rules
- Client Scripts,
and ACL Scripts, Flow scripts, Transform Maps, Script Includes, UI Macros/scripts/properties/pages
Scripting in ServiceNow is done in:
JavaScript
What is scripting in ServiceNow?
Scripting in SN or Platform Scripting is the customization of an instance and/or applications using JavaScript; and can fundamentally alter the baseline instance and user experience
Javascript may execute on the:
- Client side (web-browser)
- server side (SN database)
What is a server?
A server is the computer program running as a service; its being referred to when a client refers to an application or system
Which model uses ServiceNow?
Application Platform as a service (aPaaS)
What is the client?
The web-browser
What is a UI Policy?
A UI Policy is a rule that is applied to a form to dynamically change information or the form itself. UI Policies execute on CLIENT side.
What do yo use UI Policies for?
To set fields on a form to:
1. Mandatory or Optional
2. Hidden or Visible
3. Read-only or editable
To apply UI Policies to all views you need to:
set the Global setting to true
What can you achieve through UI Policies?
To set fields on a form to:
1. Mandatory or Optional
2. Hidden or Visible
3. Read-only or editable
Once a UI Policy is saved, UI Policy Actions determine what happens on the form:
- setting fields as mandatory - require a value in order to save record,
- setting a field as hidden - no longer displaying a field,
- setting a field as read-only - preventing users from updating its value.
Are UI Policies about security?
No, they are about user experience and data integrity
What is a Data Policy?
A Data Policy is a rule that enforces data consistency by setting fields as mandatory or read-only, and applies to all data entered into the platform.
What is a similarity and difference between UI Policies and Data Policies?
UI Policies are enforced on data ONLY entered into a form via standard browser (passing through the UI). Data Policies are applied to ALL data entered into the platform (UI, Import Sets or web services).
Where executes a Data Policy?
On the server side, but can also run as a UI Policy on the client side (if checkbox selected)
Where executes UI Policy?
On the client side
What is the purpose of Data Policies?
To standardize the same data across ServiceNow applications
What do UI Actions?
UI Actions (called click actions) add buttons, links, and context menu items on forms and lists making the UI more intuitive, customizable and specific to users.
UI Actions can execute:
Both on client and server sides depending on the “client” check bx selection.
Adding a “Create Problem” button on a form is a:
UI Action
UI Actions include:
- Form buttons
- Form context menu items
- Form links
- List buttons
- List context menu items
- List choices (at the bottom of the list)
- List links
When the UI Action Active box is checked:
the UI Action is active and can be interacted with by a user
To turn on “Save” button(/UI Action) navigate to:
All > System properties > UI Properties > select show “Save”, “Insert” and “Insert and Stay” buttons on firms
Do UI Actions require JavaScripts?
Yes
What do Client Scripts?
Client Scripts make “real-time” changes to the appearance of the user interface, especially forms.
Where to Client Scripts execute?
On the Client side, browser, but may also run a CLient Script when a database lookup is needed
Do Client Scripts require JavaScript?
Yes
Client Scripts are used to:
- automatically update the location field to reflect value user entered into the caller field,
- disable the attachment link of a closed record
- display a notice at the top of the page to confirm a catalog request was submitted
Client Scripts allows for:
Browser/form manipulation and verification such as making fields visible on a condition (eg. alert when a use changes priority of an incident)
What are the 4 types of Client Scripts?
- onCellEdit() - runs when cell changes value through list editor
- onChange() - runs when a particular fied changes value
- onLoad() - when a form is loaded
- onSubmit () - when a form is submitted
Which type of Client Script applies to a particular field on a form, rather than form itself?
onChange()
What does a Business Rule?
A Business Rule is configured to run when a record is displayed, inserted, updated, deleted or when a table is queried.
Business Rules can be set to run:
- before the database actions has occurred, or
- after the database actions has occurred.
The When setting for a Business rule determines when it executes and has the following choice:
- Before a record is saved to a database
- After a record is saved
- Async (queued), client and server work independently, so client is not waiting for server
- Display - before a record is displayed
Most customization in the platform happen via:
Business Rules
Business Rules are loaded and initialized:
at the beginning of each interaction between Client and the platform
You can assign business rules:
- to an application scope
- global environment
Business Rules apply to records:
regardless of how they are accessed (forms, lists, web services)
What is the difference between UI Policies and Business Rules?
Business Rules are NOT real-time, they don’t monitor fields on a form
Every Business Rule includes:
- what TABLE to run against,
- timing
- what CONDITIONS to evaluate
- what script to run based on evaluation
Catalog UI Policies control the behavior of:
Catalog item forms when presented to users.
Catalog UI Policies can be applied to:
- A Catalog Item
- Variable Set
Catalog Client Scripts control the behavior of catalog items when presented to users on:
- onLoad
- onChange
- onSubmit
Catalog Client Scripts run on:
client side
Best practice is to:
use “no-code” alternative if can achieve the same goal
What runs on the client side?
- UI Policies
- Client Scripts
- Catalog UI Policies
- Catalog Client Scripts
- UI Actions (can be server too)
What runs on the server side?
- Data Policies
- Business Rules
- UI Actions (can be client too)
What does applications scoping?
It protects applications by identifying and restricting access available artifacts and data
What is a (system) Update Set?
A Update Set is a group of configuration changes that can be moved from one instance to another
Update Sets allow admins to:
To group series of changes into a named set and then move them as a unit.
Every instance has a default pdate set, but:
admins should use named update sets.
AN Update set is a XML file that contains:
- A set of records details that uniquely identify the update set,
- List of configuration changes,
- A state that determines whether another instance can retrieve and apply configuration changes
When merging multiple Update Sets, if several Update Sets modified the same object,
the most recent change will be the one moved to the new, merged Update Set.
An Update Set is a:
container for configuration records (All > System Update Sets > Local Update Sets
What enables you to preview and commit Update Sets in bulk?
the “Batch Update Set” option
What is captured in an Update Set?
- Business Rules
- Client Scripts
- Fields
- Forms and Forms Sections
- Report Definitions
- Tables,
- Views
- Roles
- Published Workflows
What is NOT captured in an Update Set?
- Data Records
- Tasks
- Modified CIs
- New users and groups
- Schedules
- Scheduled Jobs
- Dashboards (but can be manually added using Unload Dashboard Function)
How to create an update set to store customization changes?
- Navigate to All > System Update Sets > Local Update Sets > New
- Complete form, click “Submit and Make Current”
- Select “In Progress”
When you have completed “recording” changes for an Update Set, you need to:
Set the state to: Completed
How to you apply an Update Set?
- Retrieve
- Preview
- Commit
How to retrieve an Update Set from a Remote instance?
- Retrieve Completed Update Sets (connectivity to each sub-instance need to be established); Update set is previewed during retrieval
- Commit
Automated Test Framework (ATF) is:
used to create and run automated tests on your SNow instances after modifying it.
By default, the property for AFT is disabled to:
To prevent running it on a PROD instancw
App Engine Studio (AES) is for:
low-code development, automating processes and solving business problems. Allows delegating development. May require additional purchase.
Delegated Developers are:
Non-admin users and groups which are assigned to one or more permissions to develop applications.
Which script runs when a record is displayed, inserted, updated, deleted or when a table is queried?
Business Rule
What is used to move customizations from one instance to another?
Update Sets
Which types of records are not captured in Update Sets?
Data records
What protects applications by identifying and restricting access to available files and data?
Application Scoping
What attributes of a field can a UI Policy Action change on a form?
- Mandatory
- Visible/hidden
- Read-only
What are the steps for applying an update set for an instance?
- Retrieve
- Preview
- Commit