ServiceNow CAD Practice Test Questions and Exam Dumps Part6 Q101-120

View Full ServiceNow CAD Exam Dumps and Practice Test Dumps.

 

Question 101

Which ServiceNow feature is used to define a reusable set of automation steps that can be called from multiple flows?

  1. UI Policy
  2. Client Script
  3. Subflow
  4. Dictionary Entry

Correct Answer: 3

Explanation

A Subflow in Flow Designer is designed to package reusable automation logic that can be invoked from multiple flows. It can contain actions, conditions, and inputs and can return outputs when required. This allows developers to avoid duplicating the same process across several flows. For example, a common approval or notification process can be created once as a subflow and reused throughout an application. UI Policies and Client Scripts manage client-side behavior, while Dictionary Entries define field metadata. Subflows support modular application design and make automation easier to maintain because shared logic can be updated centrally.

Question 102

Which API is commonly used to retrieve the current user’s unique identifier in a server-side script?

  1. gs.getUserID()
  2. gs.getUserName()
  3. current.getUserID()
  4. gs.currentUser()

Correct Answer: 1

Explanation

The gs.getUserID() method returns the unique identifier of the currently logged-in user. This is useful when server-side logic needs to identify the user performing an operation or compare the current user with another user record. The returned value is typically the user’s sys_id rather than their display name. gs.getUserName() returns the username, while the other listed methods are not the standard approach for retrieving the current user’s unique identifier. Developers should use user identity information carefully and combine it with ACLs and other security mechanisms when implementing access-related functionality.

Question 103

Which feature is used to define field-level metadata such as data type and maximum length?

  1. Business Rule
  2. Dictionary Entry
  3. UI Action
  4. Scheduled Job

Correct Answer: 2

Explanation

A Dictionary Entry defines metadata for a field or database element in ServiceNow. It can specify characteristics such as field type, maximum length, default value, reference information, and other attributes. This metadata determines how the platform handles and presents the field. Business Rules provide server-side logic, UI Actions create interactive controls, and Scheduled Jobs execute scripts at specified times. Developers frequently work with dictionary configuration when creating custom fields or modifying existing field behavior. Understanding dictionary records is important because many platform features depend on the metadata defined for tables and their fields.

Question 104

Which method is commonly used to add an encoded query to a GlideRecord object?

  1. addEncodedQuery()
  2. setEncodedQuery()
  3. queryEncoded()
  4. applyQuery()

Correct Answer: 1

Explanation

The addEncodedQuery() method allows developers to add a ServiceNow encoded query to a GlideRecord object. Encoded queries represent multiple conditions in a compact string format and are frequently copied from list filters or generated from platform query builders. Using encoded queries can simplify complex filtering logic when the encoded condition is known and appropriate. Developers should ensure that encoded query strings are correct and understandable, especially when maintaining application code. After adding the encoded query, the developer normally calls query() to execute it. This method is particularly useful when several conditions need to be represented efficiently.

Question 105

Which ServiceNow feature allows an administrator to configure application behavior without modifying JavaScript code?

  1. Hard-coded variables
  2. System Properties
  3. Database triggers
  4. Client-only scripts

Correct Answer: 2

Explanation

System Properties allow configurable values to be stored separately from application source code. Developers can retrieve these values using methods such as gs.getProperty(), allowing administrators to change application behavior without directly modifying scripts. Properties can be used for thresholds, feature switches, integration settings, and other configurable values. This approach separates configuration from implementation and makes applications easier to maintain across development, testing, and production environments. Hard-coded variables do not provide the same administrative flexibility, while database triggers and client-only scripts are not the standard ServiceNow mechanism for centralized application configuration.

Question 106

Which type of Business Rule is designed to execute in the background without making the user wait for its completion?

  1. Before
  2. Display
  3. After
  4. Async

Correct Answer: 4

Explanation

An Async Business Rule executes asynchronously in the background after the database transaction, allowing the user’s transaction to complete without waiting for the asynchronous processing to finish. This is useful for tasks that do not need to block the user, such as additional processing or certain integrations. Before Business Rules execute before a record is saved, After Business Rules execute after the database operation within the transaction, and Display Business Rules prepare data for the client. Developers should use asynchronous processing carefully because the logic cannot be relied upon to complete before the user’s transaction continues.

Question 107

Which API is commonly used to access fields dynamically on a GlideRecord?

  1. GlideElement
  2. GlideUser
  3. GlideAjax
  4. GlideDate

Correct Answer: 1

Explanation

GlideElement represents a field or element associated with a GlideRecord. It provides methods and properties that allow developers to work with individual fields dynamically. Developers can access field values, display values, labels, and other metadata through appropriate GlideElement functionality. GlideUser handles information related to users, GlideAjax supports client-to-server communication, and GlideDate is associated with date values. Understanding GlideElement is useful when writing generic scripts that need to inspect or manipulate fields programmatically rather than referencing every field directly. It is an important part of ServiceNow’s server-side scripting model.

Question 108

Which mechanism is best suited for preventing unauthorized users from deleting records?

  1. UI Policy
  2. ACL
  3. Client Script
  4. Form Layout

Correct Answer: 2

Explanation

An ACL can restrict the delete operation on a table or record based on roles, conditions, and scripts. This provides server-side security enforcement and prevents unauthorized users from deleting data through supported access paths. Client Scripts, UI Policies, and Form Layout configurations primarily affect the user interface and should not be treated as sufficient security controls. For example, hiding a Delete button does not necessarily prevent deletion through another interface or API. Developers should configure appropriate delete ACLs and test them with different user roles to ensure that only authorized users can perform destructive operations.

Question 109

Which ServiceNow feature is designed to automate record-based processes using triggers and actions?

  1. Flow Designer
  2. Dictionary
  3. Import Set
  4. Form Layout

Correct Answer: 1

Explanation

Flow Designer provides a low-code environment for automating processes using triggers, actions, conditions, and subflows. A flow can start when a record is created or updated and then perform actions such as updating records, requesting approvals, sending notifications, or interacting with supported integrations. This reduces the need for custom scripting when standard Flow Designer capabilities are sufficient. Dictionary records define field metadata, Import Sets stage external data, and Form Layout controls form presentation. Flow Designer is particularly useful for creating maintainable business process automation while keeping application logic understandable to developers and administrators.

Question 110

Which HTTP method is generally used to partially modify an existing REST resource?

  1. GET
  2. DELETE
  3. PATCH
  4. OPTIONS

Correct Answer: 3

Explanation

The PATCH HTTP method is commonly used to partially modify an existing REST resource. For example, an integration might use PATCH to update only a status or description without replacing the entire resource. GET is normally used to retrieve information, DELETE removes a resource, and OPTIONS is used for communicating supported operations and other HTTP capabilities. Exact behavior depends on the external API’s implementation, so developers should always follow the API documentation. Understanding REST methods is important when configuring ServiceNow integrations because using the wrong method can cause failed requests or unintended data changes.

Question 111

Which ServiceNow feature is used to track and package configuration changes for deployment between instances?

  1. Update Set
  2. Import Set
  3. Data Policy
  4. Notification

Correct Answer: 1

Explanation

Update Sets capture supported configuration changes and allow developers to move those changes between ServiceNow instances. They are commonly used in development workflows where configuration is created in a development instance and then transferred to testing or production. Before deployment, developers should review the Update Set to ensure that required changes are included and that dependencies are understood. Import Sets serve a different purpose by staging external data, Data Policies enforce data requirements, and Notifications communicate information to users. Update Sets are particularly useful for controlled configuration deployment when working with traditional ServiceNow development processes.

Question 112

Which GlideRecord method is commonly used to determine whether a query returned another record?

  1. next()
  2. hasRecord()
  3. exists()
  4. recordNext()

Correct Answer: 1

Explanation

The next() method moves the GlideRecord pointer to the next record in the query result set and returns a Boolean result indicating whether a record is available. A common pattern is while (gr.next()), which processes each record returned by the query. The method is therefore useful both for iterating through results and determining whether another record exists. Developers should call query() before using next() to process the results. Understanding this pattern is fundamental to GlideRecord scripting and is frequently required when processing multiple records on the server.

Question 113

What is the main purpose of a UI Policy Action?

  1. To configure how a field behaves when a UI Policy condition is met
  2. To create a database table
  3. To execute a scheduled script
  4. To define an ACL

Correct Answer: 1

Explanation

A UI Policy Action defines what happens to a field when the associated UI Policy condition evaluates to true or false. It can control properties such as whether a field is visible, mandatory, or read-only. This provides a configuration-based way to control form behavior without writing a Client Script for every simple requirement. UI Policy Actions operate on the client side and should not be used as a replacement for security controls. Database tables, scheduled scripts, and ACLs are configured through different platform features. Using UI Policy Actions appropriately can simplify form logic and reduce unnecessary custom JavaScript.

Question 114

Which ServiceNow object is commonly used to access the current record’s table name in server-side scripting?

  1. current.getTableName()
  2. current.getTable()
  3. current.tableName()
  4. current.getRecordTable()

Correct Answer: 1

Explanation

The current.getTableName() method can be used to retrieve the table name associated with the current GlideRecord. This is useful in reusable server-side logic when the script needs to determine which table is currently being processed. Developers may use table information when creating generic functions, logging diagnostic information, or handling records dynamically. The other methods listed are not the standard GlideRecord method for retrieving the current table name. Reusable Script Includes can make use of methods like this when they need to work across multiple tables or support generalized application logic.

Question 115

Which component is used to define what happens when a specific ServiceNow event is fired?

  1. Script Action
  2. Form Layout
  3. UI Policy
  4. Dictionary Entry

Correct Answer: 1

Explanation

A Script Action is designed to execute server-side logic when a configured ServiceNow event occurs. Events can be generated by application logic, and Script Actions can respond to those events to perform additional processing. This event-driven approach separates the process that generates an event from the logic that responds to it. Form Layout controls the presentation of fields, UI Policies manage client-side form behavior, and Dictionary Entries define field metadata. Script Actions can be useful when processing should occur independently of the original operation, particularly when an application uses events to coordinate different parts of its business logic.

Question 116

Which feature allows developers to control the fields displayed in a list for a specific view?

  1. List Layout
  2. Data Policy
  3. Script Include
  4. Transform Map

Correct Answer: 1

Explanation

List Layout controls which fields are displayed and how they are arranged in a ServiceNow list. Developers and administrators can configure the columns shown to users so that relevant information is immediately available when viewing multiple records. This differs from Form Layout, which controls fields presented on individual record forms. Data Policies enforce data requirements, Script Includes contain reusable server-side logic, and Transform Maps process imported data. Proper list configuration can improve productivity by ensuring that users can quickly identify important records and information without opening every individual record.

Question 117

Which API can be used to retrieve the display value of the current GlideRecord itself?

  1. getDisplayValue()
  2. getRecordDisplay()
  3. getCurrentLabel()
  4. getDisplayName()

Correct Answer: 1

Explanation

The getDisplayValue() method can be used with a GlideRecord to obtain its display value. For a record, this generally corresponds to the value configured as the table’s display field. This is useful when developers need a human-readable representation of a record rather than its sys_id. The same method can also be used in appropriate contexts to retrieve display values for fields. Other methods listed are not the standard GlideRecord method for this purpose. Using display values is particularly helpful when constructing messages, logs, or integration payloads where a readable value is more appropriate than an internal database identifier.

Question 118

Which feature allows a developer to create a custom table that extends an existing ServiceNow table?

  1. Table Extension
  2. Notification
  3. Scheduled Script
  4. UI Macro

Correct Answer: 1

Explanation

Table Extension allows a new child table to inherit fields and functionality from an existing parent table. This is useful when a custom application needs the common capabilities of an established ServiceNow table while adding application-specific fields and behavior. The child table can inherit appropriate attributes while providing its own specialized functionality. Notifications handle communication, Scheduled Scripts execute server-side logic on a schedule, and UI Macros provide reusable interface components. Developers should select the parent table carefully because inherited fields and behavior become part of the child table’s design and can influence how the application operates.

Question 119

Which practice helps reduce unnecessary database operations in a ServiceNow Business Rule?

  1. Querying the same records repeatedly
  2. Using precise conditions and avoiding unnecessary GlideRecord queries
  3. Retrieving all records on every update
  4. Performing database updates inside every loop iteration

Correct Answer: 2

Explanation

Using precise conditions and avoiding unnecessary GlideRecord queries can significantly reduce database workload in Business Rules. Developers should first determine whether a query is actually required and should restrict the query to only the records needed. Repeated queries, retrieving entire tables, and unnecessary updates inside loops can increase processing time and negatively affect system performance. Business Rules may run frequently, so inefficient logic can have a broad impact. Developers should also consider whether an existing field, relationship, or platform capability can provide the required information without an additional database query. Efficient server-side scripting is important for scalable applications.

Question 120

Which ServiceNow feature is commonly used to define reusable actions that can be invoked by Flow Designer?

  1. Custom Action
  2. Client Script
  3. Dictionary Override
  4. UI Policy

Correct Answer: 1

Explanation

Custom Actions can extend Flow Designer by providing reusable functionality that is not available through the platform’s standard actions. Developers can create custom actions with defined inputs, processing logic, and outputs, allowing flows to invoke them consistently. This approach helps bridge specialized application logic with low-code automation. Client Scripts and UI Policies primarily control browser-side behavior, while Dictionary Overrides modify inherited field configuration. Custom Actions can reduce duplicated logic and provide a structured interface between application code and automated processes. Developers should use standard Flow Designer actions when they already satisfy the requirement and introduce custom actions when additional functionality is genuinely needed.