IT CanvassTalk to an advisor
ServiceNow Snippets · LessonBy , ServiceNow Trainer, 9 yrs · Published · current release · reference

Client script snippets

Form-side snippets for g_form and g_user.

Quick answer

Browser-side helpers you reuse constantly.

Key takeaways
  • Make a field mandatory
  • Hide a field
  • Show a message

Browser-side helpers you reuse constantly.

Make a field mandatory

g_form.setMandatory('short_description', true);

Hide a field

g_form.setDisplay('u_extra', false);

Show a message

g_form.addInfoMessage('Saved successfully');

Quick check

+0 XPStreak ×0
Question 1 of 2
Which makes a field required client-side?

Frequently asked questions

What does the term Client script snippets refer to in ServiceNow?
Browser-side helpers you reuse constantly.
Already working on ServiceNow and stuck on a live ticket?Get an expert ServiceNow developer on screen-share to finish your daily tasks with you. Deliver on time, protect your reputation and your job. Monthly support only, no task-wise plans.Task assigned · no idea where to startStill stuck · your job on the lineExpert joins your screenDelivered on timeExplore On Job Support