Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
// Prevent execution when the form is loading...
if (isLoading || newValue == oldValue) return;

// Update Description field label based on Priority
if (newValue == '1') {
g_form.setLabelOf('description', 'Describe the critical issue in detail');
} else {
g_form.setLabelOf('description', 'Description');
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Dynamic Field Label Change in ServiceNow
Overview

This script is created for the Incident table to change the Description field label when the Priority field value changes.

When the Priority is set to 1 (Critical), the Description label becomes
“Describe the critical issue in detail” to help users give more clear information.
For all other priorities, it goes back to “Description.”

Setup Steps:

Go to System Definition → Client Scripts → New

Fill in the following details:

Name: Change Description Label Based on Priority

Table: Incident

UI Type: All

Type: onChange

Field name: Priority

Notes

Works only on the Incident form when the Priority field is changed.

The label updates immediately without reloading the form.

You can change the label text to fit your own use case.
Loading