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
This JavaScript code snippet is designed to validate user profile fields in ServiceNow before submission. It is particularly useful for ServiceNow developers looking to implement robust data validation mechanisms in user profiles.
3
+
4
+
# How It Works
5
+
The snippet uses a business rule that executes on form submission to validate user input:
6
+
-**Regular Expressions**: It utilizes regex patterns to check the format of the `phone` and `email` fields.
7
+
-**Error Messaging**: If the validation fails, an error message is displayed to the user, and the submission is aborted.
8
+
9
+
# Implementation
10
+
-**Add to a Business Rule**: This snippet should be incorporated into a business rule configured to run on the user profile table.
11
+
-**Adjust Validation Patterns**: Modify the `phoneNumberPattern` and `emailPattern` variables to align with your specific requirements (e.g: international phone formats).
0 commit comments