Skip to content

Commit dc7a240

Browse files
authored
Update README.md
1 parent 067a3de commit dc7a240

1 file changed

Lines changed: 20 additions & 8 deletions

File tree

  • Client-Side Components/Catalog Client Script/Regex Validation
Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,39 @@
1+
12
# Regular Expression on Catalog Client script
23

34
*****************
5+
46
8th october:
5-
This script will validate valid Adhaar number.
6-
Adhaar is a 12 digit unique identification number issues by Unique Identification Authority of India (UIDAI) for Indian Residents.
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.
7+
8+
This script will validate the Adhaar number.
9+
10+
Adhaar is a 12 digit unique identification number issued by the Unique Identification Authority of India (UIDAI) for Indian residents.
11+
12+
The script will validate Adhaar through regex, and if it is not valid, the variable is cleared with a field message.
13+
14+
The preferred OOB method for catalog variables 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.
15+
1016

1117
Regex details :
18+
1219
/^[2-9][0-9]{3}[0-9]{4}[0-9]{4}$/
20+
1321
// ^ → Start of the string
22+
1423
// [2-9] → The first digit must be between 2 and 9
24+
1525
// [0-9]{3} → Followed by exactly 3 digits (0–9)
26+
1627
// [0-9]{4} → Followed by exactly 4 digits (0–9)
28+
1729
// [0-9]{4} → Followed by exactly 4 digits (0–9)
30+
1831
// $ → End of the string
1932

2033
*****************
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.
22-
23-
* [Click here for script](script.js)
2434

35+
With the help of this code, you can easily validate the input value from the user. If it is not an Adhaar, you can clear it and throw an error message below the variable. The same validation can be used for fields instead of variables.
2536

37+
* [Click here for script](script.js)
2638

2739

0 commit comments

Comments
 (0)