- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2023 04:08 AM
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.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2023 04:34 AM
@KeDix User max_attribute variable attribute as follows.
It does not require any regular expression or scripting. For more information on variable attributes please refer to
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2023 04:45 AM
You can mention max_length attribute in variable Attribute section
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2023 04:20 AM
Hi @KeDix
Have you tries using Regular expression ?
You can create regex in this table ("question_regex")and call it in single line text
ServiceNow Developer
I know one thing, and that is that I know nothing.
- Socrates
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2023 04:39 AM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2023 04:34 AM
@KeDix User max_attribute variable attribute as follows.
It does not require any regular expression or scripting. For more information on variable attributes please refer to