Skip to content

Commit e6f9694

Browse files
authored
readme.md
spModal alerts are modern sweet alert to show the choices to be selected in an interactive way. Here, we are providing HR's to select the type of rewards in the modal page and populate a field with the selected value and show a message of the selected reward.
1 parent 07fe6e8 commit e6f9694

File tree

1 file changed

+27
-0
lines changed
  • Client-Side Components/Catalog Client Script/spModal for Sweet Alerts

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
In ServiceNow, Open catalog client Scripts [catalog_script_client] and paste the code snipper of [spModalSweetAlerts.js]
2+
3+
Setup:
4+
1. A catalog item having variable name Rewards[rewards] of type 'Select Box' with include none as true and 2 choices(Yes and No)
5+
2. A Single line field named Reward Selected [reward_selected] which will hold the value which will be sleected from the spModal
6+
3. Now, the onLoad catalog client script:
7+
Type: onChange
8+
Variable: rewards (as per step 1)
9+
Script: [[spModalSweetAlerts.js]]
10+
11+
12+
13+
Screenshots:
14+
15+
16+
<img width="1338" height="268" alt="image" src="https://github.com/user-attachments/assets/f7f22b83-7e0e-47bb-bbed-2a8f38783a4d" />
17+
18+
19+
Rewards selected as 'Yes'
20+
21+
<img width="1353" height="327" alt="image" src="https://github.com/user-attachments/assets/1bb55339-36b4-4a9c-8b65-2b254b87cf5b" />
22+
23+
From the spModal popup select anyone of the reward, it should be populated in the Reward Selected field.
24+
Along with that a message shows the same of the selection.
25+
26+
<img width="1350" height="319" alt="image" src="https://github.com/user-attachments/assets/1b23c766-51f8-4b01-9073-f836f390deb2" />
27+

0 commit comments

Comments
 (0)