IP Validation : Variable Regex vs Client Script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hello Community,
I recently worked on IP address validation for monitoring catalog forms. Instead of using a Client Script, I found that Variable Validation Regex is a better low-code option. It reduces custom scripting, is easier to maintain, and aligns with ServiceNow’s no-code/low-code approach.
1- Create the regex record
Navigation - All - Service catalog - catalog variables - variable validation regex - new
Name - for example "IP address"
Validation message - for example "Enter valid IP address"
Active - True
Regular Expression - add your regex value
Regex Flag - None
Save
2- Link regex to the variable
Navigation - All - Service catalog - catalog Definations - Maintain Item - Open your record
Open Variable - Open your existing variable for IP address
Name - IP address
Type - Single line text(must for getting validation)
Related tab - Type Specification - Validation(or Regex) - Set your "variable validation regex" record i.e "IP address"
Benefits:
Instead of creating a Client Script, writing custom validation code, and configuring separate error messages, you can simply use Variable Validation Regex. This reduces custom scripting and makes the validation easier to configure and maintain.
Please mark this post as Helpful if you found it useful.