Skip to content

Commit 2225bb9

Browse files
Create ReadMe.md
1 parent 5681118 commit 2225bb9

File tree

1 file changed

+41
-0
lines changed
  • Client-Side Components/Client Scripts/Color-coded Priority field for improved UX

1 file changed

+41
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
Dynamic Background Color for Choice Fields in ServiceNow
2+
Overview
3+
4+
This script changes the background color of a choice field dynamically based on the selected backend value.
5+
For example, in the Incident form, when the Priority changes, the field’s background color updates to visually show urgency.
6+
7+
How to Use
8+
9+
Go to System Definition → Client Scripts → New
10+
11+
Enter the following details:
12+
13+
Name: Dynamic Background Color for Choice Field
14+
15+
Table: Incident
16+
17+
Type: onChange
18+
19+
Field name: priority
20+
21+
UI Type: All
22+
23+
Save and test by changing the Priority value.
24+
25+
Key Points
26+
27+
Works for any choice field
28+
29+
Uses backend values (1, 2, 3, etc.) for color mapping.
30+
31+
Adds a smooth transition for better visual feedback.
32+
33+
Automatically resets color when default or invalid value is selected.
34+
35+
Example Color Map
36+
Backend Value Meaning Color
37+
1 Critical Red
38+
2 High Orange
39+
3 Moderate Yellow
40+
4 Low Blue
41+
5 Planning Green

0 commit comments

Comments
 (0)