ServiceNow Certified Application Developer Sample Questions
Explanation: The onLoad() method is called when a form is loaded in the ServiceNow platform. It is used to initialize data and set default values for fields on the form.
What is the best practice for securing client-side code in ServiceNow?
- A) Store the code in a UI script record
- B) Store the code directly in the HTML field of a form
- C) Store the code in a JavaScript file attached to the form
- D) Store the code in a global variable
Answer: A
Explanation: ServiceNow provides the UI script record as a best practice for storing client-side scripts. UI script records provide version control, security, and reusability. The code stored in a UI script record can be referenced by multiple forms and UI pages.
How can you access server-side data from a client-side script in ServiceNow?
- A) Use a GlideAjax call to retrieve data
- B) Use a direct server-side API call
- C) Use the g_form object to retrieve data
- D) Use the g_user object to retrieve data
Answer: A
Explanation: The GlideAjax class is used to make asynchronous server-side calls from client-side scripts in ServiceNow. This allows you to retrieve data from the server and update the form without a full page refresh.
What is the purpose of the ‘g_scratchpad’ object in ServiceNow?
- A) To store temporary data on a client-side script
- B) To store permanent data in the database
- C) To store data in memory for the duration of a session
- D) To store data in memory across multiple sessions
Answer: A
Explanation: The g_scratchpad object is used to store temporary data in a client-side script. This data is stored in memory and is not saved to the database. The g_scratchpad object is useful for storing intermediate values or data that is not needed after the form is closed.
What is the difference between a UI action and a UI policy in ServiceNow?
- A) A UI policy is used to hide or show fields, whereas a UI action is used to perform a specific function or process on the form
- B) A UI policy is executed on the server-side, whereas a UI action is executed on the client-side
- C) A UI policy is used to enforce data validation, whereas a UI action is used to redirect the user to another page
- D) A UI policy is used to update field values, whereas a UI action is used to create new records
Answer: A
Explanation: UI policies in ServiceNow are used to control the behavior of fields on a form, such as hiding or showing fields based on certain conditions, enforcing data validation, and updating field values. UI actions are used to perform specific functions or processes on the form, such as submitting a form, creating a new record, or redirecting the user to another page.
What is the difference between a UI page and a UI macro in ServiceNow?
- A) A UI page is a full-page interface, whereas a UI macro is a reusable snippet of HTML and JavaScript code
- B) A UI page is used to display data from a single record, whereas a UI macro is used to display data from multiple records
- C) A UI page is executed on the client-side, whereas a UI macro is executed on the server-side
- D) A UI page is used to create a custom form, whereas a UI macro is used to create a custom list
Answer: A
Explanation: UI pages in ServiceNow are full-page interfaces that can be used to display data from a single record or to create custom forms. UI macros are reusable snippets of HTML and JavaScript code that can be embedded within a UI page or form to add functionality or display data.
What is the purpose of the ‘gs.include’ method in ServiceNow?
- A) To include a JavaScript file in a UI page
- B) To include a server-side script in a UI page
- C) To include a client-side script in a UI macro
- D) To include a UI policy in a UI action
Answer: A
Explanation: The gs.include method is used to include a JavaScript file in a UI page in ServiceNow. This allows you to reuse code and maintain a centralized library of scripts that can be referenced by multiple UI pages or forms.
What is the difference between a client script and a UI policy in ServiceNow?
- A) A client script is executed on the client-side, whereas a UI policy is executed on the server-side
- B) A client script is used to perform calculations, whereas a UI policy is used to enforce data validation
- C) A client script is used to update the form, whereas a UI policy is used to hide or show fields
- D) A client script is used to interact with the server, whereas a UI policy is used to enforce business rules
Answer: C
Explanation: Client scripts in ServiceNow are executed on the client-side and are used to update the form and perform various calculations or manipulations on the form data. UI policies are used to enforce business rules and control the behavior of fields on the form, such as hiding or showing fields, enforcing data validation, and updating field values.
What is the difference between a Business Rule and a Client Script in ServiceNow?
- A) A Business Rule is executed on the server-side, whereas a Client Script is executed on the client-side
- B) A Business Rule is used to perform complex calculations, whereas a Client Script is used for simple calculations
- C) A Business Rule is used to enforce data validation, whereas a Client Script is used to update the form
- D) A Business Rule is used to update field values, whereas a Client Script is used to interact with the server
Answer: A
Explanation: Business Rules in ServiceNow are executed on the server-side and are used to automate processes and enforce business rules on the server. They can perform complex calculations and update field values. Client Scripts, on the other hand, are executed on the client-side and are used to update the form, perform simple calculations, and interact with the server.
What is the difference between a Workflow and a Business Rule in ServiceNow?
- A) A Workflow is used to automate processes, whereas a Business Rule is used to enforce business rules
- B) A Workflow is executed on the client-side, whereas a Business Rule is executed on the server-side
- C) A Workflow is used to update field values, whereas a Business Rule is used to perform calculations
- D) A Workflow is used to enforce data validation, whereas a Business Rule is used to update the form
Answer: A
Explanation: Workflows in ServiceNow are used to automate processes and define a series of actions that are triggered by events. Business Rules, on the other hand, are used to enforce business rules on the server and perform complex calculations and updates to field values.
Basic Sample Questions
Question 1 – Which statement below is true about the Form Designer?
- a) For adding a field to the form layout, you need to drag the field from the Fields tab to the desired destination on the form.
- b) For creating a new field on a form’s table, you need to drag the appropriate data type from the Field Types tab to the form, and then you must configure the new field.
- c) For removing a field from the form layout, you need to hover over the field to enable the Action buttons, and then you must select the Delete (X) button.
- d) For adding a section to the form layout, you need to drag it from the Field Types tab to the desired destination on the form.
- A. a, b, c, and d
- B. b, c, and d
- C. a, b, and d
- D. a, b, and c
Correct Answer: D
Question 2 – Which of the following are configured in an Email Notification?
- a) Who will receive the notification.
- b) What content will be in the notification.
- c) When to send the notification.
- d) How to send the notification.
- A. a, b and c
- B. a, b, and d
- C. b, c, and d
- D. a, c and d
Correct Answer: A
Question 3 – Scripts, reports, and other application artifacts that will appear in a published application include:
- A. Entering the name of the Application in the Global search field
- B. Opening the list of Update Sets for the instance
- C. Examining the Application Files Related List in the application to be published
- D. Opening the artifact records individually for verifying the value in the Application field
Correct Answer: B
Question 4 – Which is NOT a debugging strategy for client-side scripts?
- A. g_form.addInfoMessage()
- B. Field Watcher
- C. jslog()
- D. gs.log()
Correct Answer: D
Question 5 – If the Can read configuration field is not selected, which Application Access configuration fields are not available?
- A. All access to this table via web services
- B. Can create, Can update, and Can delete
- C. Can read does not affect the availability of other Application Access fields
- D. Allow configuration
Correct Answer: A
Question 6 – What is NOT a trigger type in Flow Designer?
- A. Outbound Email
- B. Application
- C. Record
- D. Schedule
Correct Answer: A
Question 7 – During the creation of a new application file within a scoped application, cross scope access is enabled by default?
- A. REST messages
- B. Table
- C. Script Include
- D. Workflow
Correct Answer: B
Question 8 – Which of the following is NOT true of the Weight field in an Email Notification?
- A. In each record, only notifications with the most weight are sent
- B. A Weight value of zero implies that no email must be sent
- C. Weight value defaults to zero
- D. When a Weight value of zero is set, a Notification is always sent at the time of the Notification When to send criteria
Correct Answer: B
Question 9 – To which object does the Display Business Rule NOT have access to?
- A. previous
- B. GlideSystem
- C. g_scratchpad
- D. current
Correct Answer: A
Question 10 – Which of the below-mentioned features are available to Global applications? (Choose two.)
- A. Automated Test Framework
- B. Source Control
- C. Delegated Development
- D. Flow Designer
Correct Answer: CD
Question 11 – Which is NOT a UI Action type?
- A. List choice
- B. Form button
- C. List banner button
- D. Form choice
Correct Answer: D
Question 12 – In Flow Designer, which of the following is not supported?
- A. Calling a sub-flow from a flow
- B. Testing a flow with rollback
- C. Using Delegated Developer
- D. Run ninga flow from a MetricBase Trigger
Correct Answer: B
Question 13 – Which of the following statements about ServiceNow reports is true? (Choose three.)
- A. Any user can see any report shared with them.
- B. Can be a graphical representation of data.
- C. All users can generate reports on any table.
- D. Can be run on demand by authorized users.
- E. Can be scheduled to be run and distributed by email.
Correct Answer: ABD
Question 14 – Modules must compulsorily have a Link type. Which one of the given lists is of Link types?
- A. List of Records, Separator, Catalog Type, Roles
- B. Assessment, List of Records, Separator, Timeline Page
- C. List of Records, Content Page, Order, URL (from arguments:)
- D. Assessment, List of Records, Content Page, Roles
Correct Answer: B
Question 15 – If the Allow configuration Application Access option is selected for a table, which of the following is true?
- A. Only the in-scope application’s scripts can create Business Rules for the table
- B. Any user with the application’s user role can modify the application’s scripts
- C. Out-of-scope applications can create Business Rules for the table
- D. Out-of-scope applications can add new tables to the scoped application
Correct Answer: C
Question 16 – As you work in the Form Designer, changing the label of a field changes the label of which table(s)?
- A. base table
- B. child table
- C. parent table
- D. all tables
Correct Answer: B
Question 17 – When creating a Utils Script Include, there is a basic strategy to follow. Which of the given steps does not belong.
- A. Identifying the table
- B. Scripting the function(s)
- C. Creating a class
- D. Creating a prototype object from the new class
Correct Answer: A
Question 18 – Is it possible to import applications from source control or link an application to source control with the help of a particular role? (Choose two.)
- A. source_control
- B. source_control_admin
- C. admin
- D. git_admin
Correct Answer: AC
Question 19 – How can the properties of an event that triggers an Email Notification be referenced in the content of the Email Notification?
Correct Answer: C
Question 20 – In the case of a Script Include with a Protection Policy value of Protected, which of the following is true?
- A. Users with the protected_edit role have access to the Script Include and can edit it
- B. A user with the admin role is the only one who can enable the Protection policy option
- C. A system property value for glide. app.apply_protection must be set to true in order for the Protection Policy to be applied
- D. Only applications downloaded from the ServiceNow App Store are subject to the Protection Policy
Correct Answer: B