Catalog Variable

Aniket Shukla
Tera Contributor

How to add condition on variable of multi row variable set where it does not contain any letter only digit?

 

1 ACCEPTED SOLUTION

Shivalika
Mega Sage

Hello @Aniket Shukla 

 

If the variable type is string/single line text - you can create a validation regex with this pattern.

 

^\d+$

 

Same will work for any string.

 

Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket. 

 

Regards,

 

Shivalika 

 

My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194

 

My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY

View solution in original post

3 REPLIES 3

Shivalika
Mega Sage

Hello @Aniket Shukla 

 

If the variable type is string/single line text - you can create a validation regex with this pattern.

 

^\d+$

 

Same will work for any string.

 

Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket. 

 

Regards,

 

Shivalika 

 

My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194

 

My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY

Brad Bowman
Kilo Patron
Kilo Patron

Use the variable type 'single line text' then on the Type Specifications tab you can select a pre-defined Validation Regex

BradBowman_0-1742474552712.png

If there is not one that fits what you are looking for, create one under Service Catalog > Variable Validation Regex in the left nav

BradBowman_1-1742474657900.png

 

 

Ankur Bawiskar
Tera Patron
Tera Patron

@Aniket Shukla 

No scripting required.

You can use Variable Validation Regex and attach it to your variable as shared by @Brad Bowman  

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader