HomeStudy GuidesClient Scripts

Client Scripts

ServiceNow CAD Study Guide

Overview

Client Scripts run in the user's web browser and allow developers to customize form behavior dynamically. They respond to user actions like loading a form, changing a field, or submitting a record. The g_form API provides methods to manipulate form fields, while g_user gives access to the current user's information.

Why It Matters for the Exam

Client Scripts represent 12% of the CAD exam. Questions test your knowledge of different client script types, the g_form API, and when to use client scripts vs UI policies. Understanding the client-side context and its limitations is crucial.

Key Concepts to Master

1onLoad, onChange, onSubmit, onCellEdit types
2g_form API methods
3g_user and g_list objects
4GlideAjax from client side
5Client script vs UI Policy decisions
6Mobile/Service Portal considerations
7Client script debugging
8Performance best practices

💡 Exam Tips & Strategy

Remember that client scripts run in the browser so they cannot use server-side APIs like GlideRecord directly — use GlideAjax instead. Know that onChange scripts receive control, oldValue, newValue, and isLoading parameters. The isLoading parameter helps prevent unwanted execution during form load.

11
Practice Questions
12%
Exam Weight
CAD
Certification