Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Restrict user to put lower case letter in a variable

Community Alums
Not applicable

There is one variable on my record producer, there I want to restrict the user to put lower case letter, if users enter any lower-case letter, then it will throw warning message and clear the field. Please let me know how to write the client script for this logic

2 ACCEPTED SOLUTIONS

Sai Kumar B
Mega Sage

@Community Alums No script is required

1.) Create a Regex record in the question_regex table, Regex - ^[a-z]+$

SaiKumarB_0-1668060717699.png

 

2.) Apply the regex to the variable in the Type specifications tab in the variable record

SaiKumarB_1-1668060766084.png

3.) Output

SaiKumarB_2-1668060794549.png

 

 

 

View solution in original post

Pavankumar_1
Mega Patron

Hi @Community Alums ,

Yu can use the below option.

1. Create a record on the Question Regular Expression (question_regex) table. which is used to validate the fields.

Expression: ^[A-Z]*$

Screenshot (359).png

2. And select above created  record in catalog variable form on Validation Regex.

Screenshot (360).png

If it helps please click Accept as Solution/hit the Thumb Icon.
ServiceNow Community MVP 2024.
Thanks,
Pavankumar

View solution in original post

2 REPLIES 2

Sai Kumar B
Mega Sage

@Community Alums No script is required

1.) Create a Regex record in the question_regex table, Regex - ^[a-z]+$

SaiKumarB_0-1668060717699.png

 

2.) Apply the regex to the variable in the Type specifications tab in the variable record

SaiKumarB_1-1668060766084.png

3.) Output

SaiKumarB_2-1668060794549.png

 

 

 

Pavankumar_1
Mega Patron

Hi @Community Alums ,

Yu can use the below option.

1. Create a record on the Question Regular Expression (question_regex) table. which is used to validate the fields.

Expression: ^[A-Z]*$

Screenshot (359).png

2. And select above created  record in catalog variable form on Validation Regex.

Screenshot (360).png

If it helps please click Accept as Solution/hit the Thumb Icon.
ServiceNow Community MVP 2024.
Thanks,
Pavankumar