wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

ServiceNow Coding Best Practices

Total questions: 20

Worksheet time: 14mins

Name
Class
Date
1.

What field filter should always come first when filtering log tables?

a)

Created

(sys_created_on)

b)

Message

(message)

c)

Source

(source)

d)

Level

(level)

2.

Which condition is more appropriate for a UI action:

a)

gs.isMemberOf('admins');

b)

gs.hasRole('admin');

3.

Rate this code snippet:

a)

1

b)

2

c)

3

4.

Name this glide record:

a)

gr

b)

inc_gr

c)

gr_inc

d)

highIncs

5.

New (custom) fields on an OOB table should be named

a)

With prefix:

u_

b)

Org prefix:

(e.g. sfg_)

c)

no prefix, intuitive name

d)

With prefix:

x_

6.

Rate this business rule code snippet:

a)

1

b)

2

c)

3

7.

How can we ensure to ONLY update records using a transform map without inserting new records.

a)

b)

c)

d)

8.

Pick the best example of naming variables

a)

b)

c)

d)

9.

What's the most efficient way to update a list of records?

a)

GlideRecord.update() in a while loop

b)

GlideRecord.updateMultiple() after query()

c)

GlideRecord.updateMultiple() without query()

10.

Select the best code snippet provided:

a)

b)

c)

d)

11.

Rate this code snippet:

a)

1

b)

2

c)

3

12.

Select the most appropriate code snippet for input validation:

a)

1

b)

2

c)

3

13.

Rate this code snippet:

a)

1

b)

2

c)

3

14.

Rate this code snippet:

a)

1

b)

2

c)

3

15.

Pick the best update set name

a)

OPS_JC_STRY0001_Incident form updates_v2

b)

STRY0001 - Incident form updates - v2

c)

OPS-STRY0001-v2-Incident form updates

d)

OPS-JC-STRY0001 - Incident form updates - v2

e)

Existing Customer Standard

16.

Which name is an example of camel case?

a)

myVariableName

b)

my-variable-name

c)

my_variable_name

17.

Which name is an example of snake case

a)

myVariableName

b)

my-variable-name

c)

my_variable_name

18.

When making a small customization to an OOB script...

a)

Write comments before and after the customization which reference the story/ticket

b)

Edit the code in place directly

c)

Comment the original line and write new line

19.

When making a large customization or many customizations to an OOB script...

a)

Deactivate the OOB script and create a new record

b)

Comment out the OOB lines and rewrite

c)

Write comments before and after each customization with reference to the relevant stories/tickets

20.

Select the most appropriate code snippet for updating a field value on a form

a)

b)

c)

d)