How do I restrict length of characters of variables in multi row variable set ?

Suresh karedla
Tera Contributor

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.

find_real_file.png

 

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:

find_real_file.png

 

Please help me on this.

Thanks,

Suresh

 
Topics: Service Catalog
Version: ROME
1 ACCEPTED SOLUTION

Sagar Pagar
Tera Patron

Hi @Suresh karedla,

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

find_real_file.png

 

For Regular expression, you to add new regex in Service Catalog ---> Catalog Variables ---> Variable Validation Regex with your message.

Regex - ^[a-zA-Z0-9]*$

 

find_real_file.png

Result -

find_real_file.png

 

Thanks,

Sagar Pagar

The world works with ServiceNow

View solution in original post

5 REPLIES 5

Suresh karedla
Tera Contributor

Hi @Sagar pagar,

You helped me a lot to solve the above issue and it is working good.

 

Thanks,

Suresh karedla