ServiceNow Scripting Fundamentals Flashcards

1
Q

When should you script? (5)

A
  • Add new functionality
  • Extend existing functionality
  • Guide users through messaging (alerts/notification)
  • Automate processes
  • Interact with third party applications
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Which administrator develops in the global scope?

A

System Administrator

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Which administrator develops in a certain piece (like business rules), typically within a certain application?

A

System Definition Administrator

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the name of ServiceNow’s built in text editor and what are it’s features?

A

Syntax Editor:
- Automatic Javascript syntax coloring, auto-indentation, line numbers, creation of closing braces and quotes
- Context-sensitive help
- Code editing functions
- Syntax Editor Macros for typing commonly used code
- Syntax error checking

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What color does blue represent in the Syntax Editor?

A

Reserved words

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What do Bold/Italics represent in the Syntax Editor

A

Context menu items

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What does the color green represent in the Syntax Editor?

A

Comments

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How does Syntax Editor help with braces and quotes?

A
  • It automatically adds the closing quote, braces or parenthesis
  • It highlights pairs of brackets/parentheses
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the benefit of using single quotes in JavaScript?

A

Values within single quotes can be compared with equals, equals equals, numeric comparisons and more.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What functionalities does the Context-sensitive Help provide?

A
  • Displays a list of valid elements at the cursor’s current position
  • Lists methods for a class
  • Lists expected parameters
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How do you display valid elements at the cursor’s current position within the Syntax Editor?

A

CTRL + Spacebar at the beginning of a line

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How do you view a list of methods for a class within the Syntax Editor?

A

Type a period after the class name

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How do you view a list of expected parameters for a class or method?

A

Type open parenthesis after a valid class, function or method name.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

If you create custom objects, does the Syntax Editor provide any suggestions for variables belonging to the object?

A

Yes, if you type a period after the object, it will suggest variables belonging to the object.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What options are presented when you right click on bold/italicized text within the Syntax Editor?

A

The context menu:
- Show definition
- Show data
- Find references

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How do you find a list of other places an object is used from within Syntax Editor?

A

Right click on the context menu and click ‘Find references.’

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What is an alternative method of adding commments to manually typing forward slashes?

A
  1. Highlight applicable text
  2. Click the “Toggle Comment” button in the bar at the top of the Syntax Editor.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

True or false: “Replace all” asks for confirmation before making the replacement(s)?

A

False. It does not.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What contains shortcuts for commonly used code?

A

The Syntax Editor Macros

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

How do you insert a Syntax Editor macro into your code?

A

Type the macro name and press tab.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

How do you find the full list of Syntax Editor macros within the editor?

A

Type “help” and press tab.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What can the Syntax Editor “Syntax Checker” find?

A
  • Missing characters, such as { and [
  • Missing ; at the end of statements
  • Incomplete arguments in for loops
  • Bad function calls
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

What is the Syntax Editor “Syntax Checker” not able to find?

A

Typos, in:
- variable names
- function calls
- method calls

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What do red circles indicate in Syntax Editor? Orange?

A
  • Red: Errors
  • Orange: Warnings
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

What type of script presents an error at the bottom of the script if you attempt to save it without resolving an error?

A

Server-side

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

How do you view all configuration changes made to a table?

A

Type the table name in the Filter Navigator and append with .config

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

What are client scripts used for?

Provide 7 examples.

A

Managing behavior of forms, fields and lists in real time
- Make fields mandatory
- Set one field in response to another
- Modify choice list options
- Hide/show form sections
- Hide fields
- Display alerts
- Manage/prohibit list editing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

When is an “onLoad” client script run?

A

On load BEFORE control is given to the user.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

When is the “onSubmit” client script run?

A

When the form is saved, submitted or updated (when a button is clicked)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

What are “onSubmit” client scripts typically used for?

A

Field validation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

What is the purpose of an “onChange” client script?

A
  • Respond to field values of interest
  • Modify one field value in response to another
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q

When might you use the ‘isTemplate’ parameter?

A

When you want to prevent a client script from running when a template is to be applied so that values from the template aren’t overwitten.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
33
Q

In an onChange client script, what does oldValue represent and when does it change?

A

The date saved in the server.

Old value is not changed until it is saved back to the server again.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
34
Q

What is the purpose of the GlideForm API?

A
  • Customizing the view of forms
  • Managing form fields and their data
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
35
Q

Which value, server or form, does g_form.getValue() retrieve?

A

Value selected on form

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
36
Q

When g_form.getValue() is called against a string field, what is returned?

A

The string field as it appears on the form

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
37
Q

When g_form.getValue() is called against a non-string field, what is returned?

A

The value as it is saved in the server, not the display/user-friendly label.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
38
Q

What functionality does the GlideUser API provide?

A

Methods to access information about the currently logged in user.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
39
Q

What scope does the GlideUser API belong to?

A

Global

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
40
Q

Which debugging method is suggested for catching runtime errors?

A

Try/catch

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
41
Q

How are views input on the client script record?

A

Comma separated list

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
42
Q

In what order to client scripts run if they have the same value in the “order” field?

A

Either by created or the sys ID with the lower hexadecimal value.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
43
Q

What causes a GlideRecord query to execute the query?

A

gr.query();

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
44
Q

How would you check if a GlideRecord query has another record?

A

if(myObj.hasNext()) {}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
45
Q

How do you add an OR condition to a GlideRecord query?

A
  1. Create the GlideRecord object
  2. Create a new variable and assign your addQuery to it
  3. Run .addOrQuery on the variable created in the step above

var gr = new GlideRecord(‘table’);
var q1 = gr.addQuery(‘cat’, ‘lucy’);
q1.addOrQuery(‘cat’, ‘felix’);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
46
Q

What would your query be if you wanted the following:
- State is 3 or State is 5
- AND priority is 1 or impact is 1

A

var gr = new GlideRecord(‘incident’);
var q1 = addQuery(‘state’, 3);
q1.addOrQuery(‘state’, 5);
var q2 = addQuery(‘priority’, 1);
q2.addOrQuery(‘impact’, 1);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
47
Q

When counting records, what is the benefit of using getRowCount?
What is the benefit of GlideAggregate?

A
  • getRowCount: Less code but larger performance impact. Because it’s getting all the records/their details and then counting them.
  • GlideAggregage: More code but executes quicker
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
48
Q

How do you use getRowCount?

A

After .query(), assign gr.getRowCount() to a new variable.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
49
Q

How do you use GlideAggregate?

A

var count = new GlideAggregate(‘table’);
count.addQuery(‘field’, ‘value’);
count.addAggregate(‘COUNT’);
count.query();
var incidentCount = 0;
if (count.next()) {
incidents = count.getAggregate(‘COUNT’);
}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
50
Q

When is it recommended to use GlideAggregate?

A

If your table has more than 100 rows.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
51
Q

What are three benefits of GlideQuery?

A
  • Presents errors as soon as possible (Fail fast)
  • Behaves like normal Javascript, instead of mixing Java and Javascript elements like GlideRecord
  • Do more with less lines of code
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
52
Q

How do you write the following query in GlideQuery?

var gr = new GlideRecord(‘task’);
gr.addQuery(‘closed_date’, ‘<’ ‘2016-01-01’);
gr.query();
gr.deleteMultiple();

A

new GlideQuery(‘task’)
.where(‘closed_date’, ‘<’ ‘2016-01-01 00:00:00’)
.deleteMultiple();

*Note how there are no semicolons until the last statement.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
53
Q

The following query’s field is mistyped. What happens when it is executed?

var gr = new GlideRecord(‘task’);
gr.addQuery(‘closed_date’, ‘<’ ‘2016-01-01’);
gr.query();
gr.deleteMultiple();

A

The addQuery is ignored.
All task records are deleted and no error is generated.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
54
Q

The following query’s field is mistyped. What happens when it is executed?

new GlideQuery(‘task’)
.where(‘closed_date’, ‘<’ ‘2016-01-01 00:00:00’)
.deleteMultiple();

A

The NiceError shows the problem and known fields

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
55
Q

How do you write this query in GlideQuery?

var gr = new GlideRecord(‘task’);
gr.addQuery(‘approval’, ‘not requested’);
gr.query();
while (gr.next()) {
doSomething(gr.assigned_to,gr.description);
}

A

new GlideQuery(‘task’)
.where(‘approval’, ‘not requested’)
.select(‘assigned_to’, ‘description’)
.forEach(doSomething);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
56
Q

In the code below, ‘not_requested’ is not a valid choice. What happens when it is executed?

var gr = new GlideRecord(‘task’);
gr.addQuery(‘approval’, ‘not_requested’);
gr.query();
while (gr.next()) {
doSomething(gr.assigned_to,gr.description);
}

A

The script runs, but no results are returned.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
57
Q

In the code below, ‘not_requested’ is not a valid choice. What happens when it is executed?

new GlideQuery(‘task’)
.where(‘approval’, ‘not_requested’)
.select(‘assigned_to’, ‘description’)
.forEach(doSomething);

A

The NiceError shows the invalid choice and allowed values.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
58
Q

The priority value used in the code below is invalid. What happens when it is executed?

new GlideQuery(‘task’)
.where(‘priority’, ‘<’, ‘v’)
.whereNotNull(‘assigned_to’)
.select(‘assigned_to.name’, ‘priority’)
.forEach(doSomething);

A

The NiceError shows the type error and the expected type.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
59
Q

How do you check the type of a value?

A

typeof(whatyourechecking)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
60
Q

Which values are falsy?

A

All values are truthy unless they are defined as falsy:
* false
* 0
* -0
* 0n
* “”
* null
* undefined
* NaN

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
61
Q

How do you create a record with the following attributes using GlideQuery on the sys_user table?
- Username: sock.monkey
- First name: Sock
- Last name: Monkey
- Roles: admin

A

new GlideQuery(‘sys_user’)
.insert({
user_name: ‘sock.monkey’,
first_name: ‘Sock’,
last_name: ‘Monkey’,
roles: ‘admin’
})
.get()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
62
Q

How do you retrieve roles from a record on the sys_user table with the username of sock.monkey using GlideQuery?

A

var newUser = new GlideQuery(‘sys_user’)
.where(‘user_name’, ‘sock.monkey’)
.selectOne(‘roles’)
.get();

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
63
Q

How do you update the roles of a specific user record with GlideQuery when the sys ID is known? Role to be updated is itil.

A

new GlideQuery(‘sys_user’)
.where(‘sys_id’, sysID)
.update({
roles: ‘itil’
});

64
Q

How do you delete a record with GlideQuery?

A

new GlideQuery(table)
.where(field, value)
.deleteMultiple();

65
Q

What class is used with GlideQuery when multiple records need to be read?

A

Stream

66
Q

With which method are records returned with the Stream class when using GlideQuery()?

A

.select()

67
Q

What methods can be used in combination with the Stream class and the .select() method? (5)

A
  • map
  • flatMap
  • forEach
  • reduce
  • some/any
68
Q

What class is used with GlideQuery to read a single record?

A

Optional

69
Q

What are 5 common methods that return an object of the Optional class?

A

Any of these:
- get
- map
- isEmpty
- isPresent
- ifPresent
- orElse
- selectOne
- insert()
- update()

70
Q

When does the Optional class return “empty” when using GlideQuery?

A

If no records are returned

71
Q

What does .select() do within GlideQuery?

A

Limits the fields returned by the query to the ones specified.
- It is analogous to .query() within GlideRecord.

72
Q

What does .where() do within GlideQuery?

A

Filters the records to be returned by the query.

73
Q

How do you specify that a specific number of records be returned by GlideQuery?

A

.limit(x)

74
Q

How do you perform a specific action on each record when running a GlideQuery?

A

.forEach()

75
Q

What are 2 GlideQuery methods that allow you to return 1 record without using .limit()?

A

.selectOne(field, value)
.get();

76
Q

Is GlideRecord or GlideQuery faster?

A

GlideRecord
- GlideQuery has to be translated into GlideRecord.

77
Q

True or False:
A script include can be configured so that it is callable from both server-side and client side.

A

False
It must be set up for one or the other.

78
Q

What are the 3 types of script includes?

A
  • Classless script storing one function
  • Definition of a new class
  • Extension of an existing class
79
Q

What class is extended when “Client callable” is checked on a script include?

A

AbstractAjaxProcessor

80
Q

True or False:
You are unable to initialize custom variables within a script include that extends another script include.

A

True.
- It uses the initialize function of the script include you are extending.

81
Q

What are the steps for calling a script include client-side?

A
  1. Create a new GlideAjax object for the script include of interest
    - var ga = new GlideAjax(‘HelloWorld’);
  2. Pass parameters to the script include. sysparm_name is a reserved parameter used to represent the name of the method.
    - ga.addParam(‘sysparm_name’, ‘alertGreeting’);
    - ga.addParam(‘sysparm_user_name’,’Ruth’);
  3. Make call to the server. Sends an XML containing parameters to the script include. HelloWorldParse is the name of the callback function.
    - ga.getXML(HelloWorldParse);
  4. Callback function processes returned data
    - function HelloWorldParse(response) {
    var answerFromXML = response.responseXML.documentElement.getAttribute(“answer”);
    alert(answerFromXML);
    }
82
Q

How do you read a parameter from the client-side call within a script include?

A

this.getParameter(‘sysparm_parameter_name’)

83
Q

What does JSON stand for?

A

JavaScript Object Notation

84
Q

What is a more efficient way to return data from a client-callable script include?

A

Using JSON
- You can return a stringified object or array of objects.

85
Q

How do you access values from the JSON object received from a client-callable script include?

A

Within the callback function, parse the object received.
- You can dot walk from the parsed objec to get specific values.
- You can access elements by index if an array was returned and then dot walk for their attributes.

86
Q

Under which application is Flow Designer found?

A

Process Automation

87
Q

Where can the Flow API be used?
The FlowScript API?

A
  • Flow API: Outside of Flow Designer (Scripts, Background, business Rules) and inside Flow Designer, for example to call other flows)
  • FlowScript API: Only inside FlowDesigner
88
Q

What two categories do scripts within ServiceNow fall into?

A
  • Client-side
  • Server-side
89
Q

Give 5 examples of client script uses.

A

Any 5 of the following
- Place the cursor in a form field on form load
- Generate alerts, confirmations and messages
- Populate a form field in response to another field’s value
- Highlight a form field
- Validate form data
- Modify choice list options
- Hide/Show fields or sections

90
Q

When can client-side scripts execute?

A

When:
- Form loaded
- Form submitted
- Field value changed

91
Q

Which type of script should be used to validate field values?

A

onSubmit

92
Q

When configuring a client script, what options exist within “UI Type?”

A
  • Desktop
  • Mobile/Service Portal
  • All
93
Q

When configuring a client script, what options exist under “Type?”

A
  • onChange
  • onLoad
  • onSubmit
  • onCellEdit
94
Q

What is enabled when “Inherited” is marked as true on a client script?

A

The ability of the script to be evaluated on tables extended from the table the script was configured for.

95
Q

What is true if the “Global” checkbox is checked? If it is not checked?

A
  • True: The script applies to all views.
  • False: Applies only to the views you manually specify.
96
Q

What arguments are passed to an onLoad client script?

A

None.

97
Q

What is the syntax for the onLoad script template?

A

function onLoad() {}

98
Q

What arguments are passed to an onSubmit client script?

A

None.

99
Q

What is the syntax for the onSubmit script template?

A

function onSubmit() {}

100
Q

What parameters are passed into an onChange client script?
What do they represent?

A
  • control: field the Client Script is configured for
  • oldValue: value of the field when the form loaded. Value held in the database.
  • newValue: value of the field after the change
  • isLoading: boolean value indicating whether the change is occurring as part of a form load.
  • isTemplate: boolean value indicating whether the change occurred due to population of the field by a template.
101
Q

What occurs when a record is selected?

A
  • The form and form layout are rendered
  • Fields are populated with values from the database
102
Q

What is the syntax for an onChange client script?

A

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue == ‘’) {
return;
}
}

103
Q

When is the value of “oldValue” set for an onChange client script?

A

When the form loads.

104
Q

A record has a short description field holding the value of “hello”.
What is the value of oldValue and newValue after each of the following events?
1. Form loads:
2. User changes the value in the Short description field to bye:
3. User changes the value in the Short description field to greetings:
4. User saves the form and reloads the form page:

A
  1. oldValue = hello, newValue = no value
  2. oldValue = hello, newValue = bye
  3. oldValue = hello, newValue = greetings
  4. oldValue = greetings, newValue = no value
105
Q

How do you get to client scripts within Studio?

A

Client Development > Client Scripts

106
Q

What is the purpose of methods within the GlideForm API?

A

Managing forms and form fields

107
Q

What are some capabilities of the GlideForm API (6)?

A
  • Retrieve a field value on a form
  • Hide a field
  • Make a field read-only
  • Write a message on a form or a field
  • Add fields to a choice list
  • Remove fields from a choice list
108
Q

What object is used to access GlideForm methods?

A

g_form

109
Q

What are 5 ways to debug Client Scripts or UI policies?

A
  • Browser’s Developer Console
  • Debug UI Policies module
  • JavaScript try/catch
  • JavaScript Log and jslog()
  • Field Watcher
110
Q

Do UI Policies execute UI Policy scripts only when the Condition field evaluates to true? Explain your reasoning.

A

If the Reverse if False option is selected, UI Policies execute the “Execute if false” script when the Condition field evaluates to false.

111
Q

Which of these classes are part of the ServiceNow client-side API?
- GlideSystem
- GlideUser
- GlideDateTime
- GlideDate
- GlideForm

A
  • GlideUser
  • GlideForm
112
Q

When do onSubmit client scripts execute their script logic?
1. When a user clicks the Submit button
2. When a user clicks the Delete button
3. When a user clicks the Update button
4. When a user clicks the Save menu item in the Additional Actions menu
5. When a user clicks the Lookup button on a reference field.

A
  • When a user clicks the Submit button.
  • When a user clicks the Update button
  • When a user clicks the Save menu item in the Additional Actions menu
113
Q

True or False:
A single Client Script can execute its script logic when a user loads a record into a form AND when a user saves/submits/updates a form.

A

False.

A single client script can be either onLoad or onSubmit but cannot be both.

114
Q

True or False:
A single Client Script can execute its script logic when a user loads a record into a form AND when a user changes a value in a field.

A

True.

An onChange client script could handle this behavior. When a form is loaded, field/variable values that are populated are technically changed from blank to the value held in the database.

115
Q

True or False:
UI Policies require scripting to make form fields Mandatory, Visible or Read-only.

A

False.

UI Policy actions can set field attributes without scripting.

116
Q

When can UI policies execute their logic?
- When a record is loaded into a form
- When field values change on a form
- When a form is saved, submitted or updated
- When a Client Script executes
- When a record is loaded into a list

A
  • When a record is loaded into a form
  • When field values change on a form
117
Q

Which object is used to access GlideUser methods and properties?

A

g_user

118
Q

How do you check whether a user has a specific role from a client script?

A

g_user.hasRole()

119
Q

How do you check whether a user has a role directly assigned, ?aka it is not inherited?

A

g_user.hasRoleExactly()

120
Q

Which executes first, UI policy actions or UI policy scripts?

A

UI policy actions execute before UI policy scripts

121
Q

What does red text in the syntax editor represent?

A

Strings

122
Q

What does teal text represent in the syntax editor

A

Function/variable names

123
Q

What does .select() do in GlideQuery?

A

Specifies which fields to return
Returns a stream containing results of the query

124
Q

What does .selectOne() do in GlideQuery?

A

Specifies which fields to return
Returns an optional which may contain a single record

125
Q

What are the parameters for the GlideQuery method .insert()?

A

keyvalues, [selectedFields]

126
Q

What does the .update() method do in GlideQuery? What does it return?

A

Updates an existing record
Returns an optional of the newly updated record

127
Q

What are 3 qualities of the Stream class?

A
  • Used for returning/reading multiple records
  • Data is returned like a JavaScript array
  • Lazily evaluated allowing millions of records to be queried without allocating large amounts of memory
128
Q

What are 2 qualities of the Optional class?

A
  • Used for reading a single record
  • Is considered “empty” if a record isn’t returned by the query
129
Q

What does the .forEach() GlideQuery method do?

A

Iterates through records returned by the query.

130
Q

What does the .get() GlideQuery method do?

A

Displays a single GlideRecord query result

131
Q

What type of script include is not client-callable even if the checkbox is marked as true?

A

Classless, ones in which the default template is deleted.

132
Q

What must be true for a function that is not declared first in a classless script include to be called?

A

The first script must have been completed execution first.

133
Q

How do you call a function from a classless script include?

A

Reference only the method name.

134
Q

What does AJAX stand for?

A

Asynchronous JavaScript and XML

135
Q

When is g_scratchpad set?

A

On form load

136
Q

What is the syntax to call a script include that exists in another scope?

A

Prepend the script include’s name with the unique scope namespace.

137
Q

What role is given for users to develop in flow designer?

A

flow_designer

138
Q

Why should granting the flow_designer role be done with caution?

A

It gives the user access to all tables and database operations, which is equal to the admin role.

139
Q

What 7 links are on the Flow Designer homepage?

A
  • Flows
  • Subflows
  • Actions
  • Flow Executions
  • Connections
  • Help
  • New
140
Q

Define “Flow.”

A

An automated process consisting of a trigger and sequence of actions.

141
Q

Define “Subflow.”

A

A sequence of reusable actions that can be started from a flow, subflow or script.

142
Q

Define “Action” as it relates to Flow Designer.

A

A reusable operation that enables Process Analysts to automate new platform features without having to write code.

143
Q

Define “Flow execution.”

A

A list of associated execution detail pages. Each page is created when a flow runs and stores information about configuration and runtime values.

144
Q

What is the purpose of the “Connections” link on the Flow Designer homepage?

A

Add, edit and view Integration Hub connections.

145
Q

What is the purpose of the “Help” link on the Flow Designer homepage?

A

Contains links to documentation, videos and community discussions

146
Q

What options are available when you click “New” in Flow Designer?

A

Create a new Flow, Subflow or Action

147
Q

What are the 3 flow designer triggers?

A
  • Record
  • Schedule (Date)
  • Application
148
Q

What does a record-based trigger require in Flow Designer? (2)

A
  • Table to monitor
  • Condition to start the flow
149
Q

What choice do you select if you want the flow to run repeatedly in predefined intervals?

A

Repeat

150
Q

Which executes first, client script or UI policy? If there is a conflict between a client script and UI policy?

A
  • Default: Client script
  • In conflict: UI policy

https://developer.servicenow.com/dev.do#!/learn/courses/washingtondc/app_store_learnv2_scripting_washingtondc_scripting_in_servicenow/app_store_learnv2_scripting_washingtondc_client_side_scripting/app_store_learnv2_scripting_washingtondc_client_scripts_vs_ui_policies

151
Q

Which standards does the Javascript engine in ServiceNow support?

A

ECMAScript5 and ECMAScript 2021

152
Q

Which system property enables/disables display of the context editor?

A

glide.ui.syntax_editor.context_menu

153
Q

Which font style is used for tokens with a context menu?

A

Bold

154
Q

Where are syntax editor macros located?

A

System Definition > Syntax Editor Macros

155
Q

Which script type will save with syntax errors?

A

Client

156
Q

What is an artifact?

A

Application files in an application.