nerdexam
ServiceNow

CAD · Question #253

What is the correct use of g_scratchpad in a ServiceNow client script?

The correct answer is A. To store temporary server-side variables that can be accessed from the client. The g_scratchpad object is used in ServiceNow to transfer temporary server-side data from a Display Business Rule to a client script when a form loads.

Submitted by devops_kid· Apr 18, 2026Application User Interface

Question

What is the correct use of g_scratchpad in a ServiceNow client script?

Options

  • ATo store temporary server-side variables that can be accessed from the client.
  • BTo reference data in the global scope for client-side scripting.
  • CTo execute server-side functions in client scripts.
  • DTo maintain session data for users.

How the community answered

(53 responses)
  • A
    89% (47)
  • B
    4% (2)
  • C
    2% (1)
  • D
    6% (3)

Why each option

The `g_scratchpad` object is used in ServiceNow to transfer temporary server-side data from a Display Business Rule to a client script when a form loads.

ATo store temporary server-side variables that can be accessed from the client.Correct

`g_scratchpad` serves as a temporary object populated by a Display Business Rule on the server-side, allowing it to pass non-field data to client scripts for use when the form loads, thus facilitating server-to-client data transfer.

BTo reference data in the global scope for client-side scripting.

While `g_scratchpad` is a global client-side object, its specific purpose is for data transfer from server to client, not for referencing arbitrary global scope data.

CTo execute server-side functions in client scripts.

`g_scratchpad` is for data transfer, not for executing server-side functions; `GlideAjax` is typically used for calling server-side functions from client scripts.

DTo maintain session data for users.

`g_scratchpad` data is transient and specific to a single form load, making it unsuitable for maintaining long-term user session data.

Concept tested: g_scratchpad for server-to-client data transfer

Source: https://docs.servicenow.com/bundle/utah-application-development/page/script/client-scripts/concept/g_scratchpad_reference.html

Topics

#g_scratchpad#Client Scripting#Server-Client Communication#Form Customization

Community Discussion

No community discussion yet for this question.

Full CAD Practice