You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# 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
0 commit comments