- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2022 11:10 PM
How do I restrict length of characters of variables in multi row variable set and only alpha-numeric characters should be allowed
I have create a multi row variable set for catalog item form.
So that I can add multiple customer codes just by clicking on add.
How to validate to allow only alpha - numeric characters and miimum and maximum characters 6 or 7 (example: test123)
if i use client script getting out as below:
Please help me on this.
Thanks,
Suresh
Solved! Go to Solution.
- Labels:
-
User Interface (UI)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2022 12:02 AM
Hi
You have to use the max_length=7 as variable attributes for Customer Codes[customer_code] variable in MRVS * annotations as
Enter Customer Codes up-to 5 characters only
For Regular expression, you to add new regex in Service Catalog ---> Catalog Variables ---> Variable Validation Regex with your message.
Regex - ^[a-zA-Z0-9]*$
Result -
Thanks,
Sagar Pagar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2022 11:45 PM
Hey,
Have you explored on Variable Validation Regex?
It is a no code way for validating catalog variables using Regular expression.
Your regular expression would be something like this:
/^([a-zA-Z0-9_-]){6,8}$/ where it means it can have size from 6 to 8, if you want only lower limit you can update as (6,}
Below article helps you to achieve this
Service Portal Catalog Items: Regex Field Validation [Madrid]
Feel free to mark correct, If I answered your query.
Will be helpful for future visitors looking for similar questions 🙂
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2022 01:17 AM
Thank you Aman kumar for your help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2022 12:02 AM
Hi
You have to use the max_length=7 as variable attributes for Customer Codes[customer_code] variable in MRVS * annotations as
Enter Customer Codes up-to 5 characters only
For Regular expression, you to add new regex in Service Catalog ---> Catalog Variables ---> Variable Validation Regex with your message.
Regex - ^[a-zA-Z0-9]*$
Result -
Thanks,
Sagar Pagar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2022 12:05 AM