How to limit single line text variable on Record Producer to max length as user type in the value

KeDix
Tera Expert

How to limit single line text variable on Record Producer to max length as user type in the value.

It can be done on OnChange but, the issue with that is it works only when the focus is moved out from the field/variable.

1 ACCEPTED SOLUTION

Sandeep Rajput
Tera Patron
Tera Patron

@KeDix User max_attribute variable attribute as follows.

 

Screenshot 2023-09-26 at 4.58.13 PM.png

 

Screenshot 2023-09-26 at 4.56.30 PM.png

It does not require any regular expression or scripting. For more information on variable attributes please refer to 

https://docs.servicenow.com/bundle/utah-servicenow-platform/page/product/service-catalog-management/...

View solution in original post

8 REPLIES 8

You can mention max_length attribute in variable Attribute section

Vishal Birajdar
Giga Sage

Hi @KeDix 

 

Have you tries using Regular expression ?

You can create regex in this table ("question_regex")and call it in single line text 

 

VishalBirajdar_0-1695727152262.png

 

 

 

 

Vishal Birajdar
ServiceNow Developer

I know one thing, and that is that I know nothing.
- Socrates

@Vishal Birajdar 

I do not have a Validation Regex option for the Single Line Text variable on Record Producer.

Attached is a screenshot for reference. 

I have the top section fields selected/filled but, removed in the screenshot.

Sandeep Rajput
Tera Patron
Tera Patron

@KeDix User max_attribute variable attribute as follows.

 

Screenshot 2023-09-26 at 4.58.13 PM.png

 

Screenshot 2023-09-26 at 4.56.30 PM.png

It does not require any regular expression or scripting. For more information on variable attributes please refer to 

https://docs.servicenow.com/bundle/utah-servicenow-platform/page/product/service-catalog-management/...