The CreatorCon Call for Content is officially open! Get started here.

Should not contain alphabets special characters in the variable and allows only limited digits

Amrutha K V
Tera Contributor

Hi Team,

I have a Single Line Text variable named 'Select numbers in between 6 to 9' . Which should not contain alphabets,special characters and it should take only digits in between 6 to 9. The same time we have to populate a message : 'Please select numbers in between 6 to 9'. Could you please help me here by using onchange catalog client script. 

Thank you!

5 REPLIES 5

Anirudh Pathak
Mega Sage

Hi @Amrutha K V ,

1. Navigate to Service Catalog < Catalog Variables < Variable Validation Regex.

2. Create a new record by Clicking on "New" UI Action button.

3. In the "Regular expression" field put "  ^[6-9]*$  ".  Fill all the other fields and submit the record.

4. Open Single line text variable for which you want to validate the above expression.

5. In the "Type specifications" tab of the variable there would be a field called "validation regex".

6. Select the record name in the "validation regex" field which you created in step 3. Save the record.

7. You would be able to see the desired validation.