Skip to content

Commit 37cb7ed

Browse files
authored
Create README.md
1 parent e2e70a8 commit 37cb7ed

File tree

1 file changed

+43
-0
lines changed
  • Client-Side Components/Client Scripts/Display Custom Field Based on Incident Channel Field and populate with Caller Information

1 file changed

+43
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Display Custom Email/Phone Field Based on Incident Channel Field and Populate those Field with Caller Information
2+
3+
Displays either the **Email** or **Phone** field on the **Incident** form based on the selected **Channel** value (Email or Phone) and populate the fields with the caller’s details.
4+
5+
### Use Case
6+
- When **Channel = Email**, the **Email** field becomes visible and is auto-populated with the caller’s email address
7+
- When **Channel = Phone**, the **Phone** field becomes visible and is auto-populated with the caller’s mobile number
8+
- Both details fetched from the caller’s record from **sys_user** table.
9+
- The custom Email and Phone fields may also serve as placeholder to update if details differ from the caller record
10+
11+
### Prerequisites
12+
- Create Two custom fields on Incident Table
13+
- **u_email** which captures store the caller’s email address
14+
- **u_phone** which capture caller’s mobile number
15+
- Create **Two UI Policies** which hides the u_email and u_phone field unless channel choice is phone or email
16+
- Create an onChange Client Script that calls a GlideAjax Script to fetch the caller’s contact details and populate the custom Email or Phone field on the Incident form
17+
- To further enhance usecase Regex used on Phone field. Refer (https://github.com/ServiceNowDevProgram/code-snippets/pull/2375)
18+
19+
---
20+
21+
### Incident Record when channel choice is other than Email or Phone
22+
23+
![Display_CustomField_Autopopulate_Caller_3](Display_CustomField_Autopopulate_Caller_3.png)
24+
25+
---
26+
27+
### Incident Record when Channel choice is email and populate Email Field by caller's Email
28+
29+
![Display_CustomField_Autopopulate_Caller_1](Display_CustomField_Autopopulate_Caller_1.png)
30+
31+
---
32+
33+
### Incident Record when channel choice is phone and populate Phone Field by caller's Phone Number
34+
35+
![Display_CustomField_Autopopulate_Caller_2](Display_CustomField_Autopopulate_Caller_2.png)
36+
37+
---
38+
39+
40+
41+
42+
43+

0 commit comments

Comments
 (0)