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
Copy file name to clipboardExpand all lines: Client-Side Components/Catalog Client Script/Regex Validation/README.md
+12-1Lines changed: 12 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,8 +3,19 @@
3
3
*****************
4
4
8th october:
5
5
This script will validate valid Adhaar number.
6
-
Adhaar is a 12 digit unique identification number issues by UIDAI in India for Indian Residents.
6
+
Adhaar is a 12 digit unique identification number issues by Unique Identification Authority of India (UIDAI) for Indian Residents.
7
7
The script will validate Adhaar through regex and if it is not valid, variable is cleared with field message.
8
+
For Catalog variables Preferred OOB method is listed here : https://www.servicenow.com/docs/bundle/xanadu-servicenow-platform/page/product/service-catalog-management/task/define-regex-vrble.html . The same regex can be defined in "Variable Validation Regex" module.
9
+
For Normal fields, this entire scriopt can be used.
10
+
11
+
Regex details :
12
+
/^[2-9][0-9]{3}[0-9]{4}[0-9]{4}$/
13
+
// ^ → Start of the string
14
+
// [2-9] → The first digit must be between 2 and 9
15
+
// [0-9]{3} → Followed by exactly 3 digits (0–9)
16
+
// [0-9]{4} → Followed by exactly 4 digits (0–9)
17
+
// [0-9]{4} → Followed by exactly 4 digits (0–9)
18
+
// $ → End of the string
8
19
9
20
*****************
10
21
With the help of this code you can easily validate the input value from the user and if it's not a email format you can clear and throw a error message below the variable. Of course you can use Email type variable as well but you cannot have a formatted error message.
0 commit comments