
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-13-2023 06:19 AM
Afternoon, is anyone able to confirm if this can be done please. When building a catalog item, is it possible to set a maximum length value on a single line text variable unique to that variable?
I cant change the current dictionary value because of the following warning: The field 'Question' on table 'Question' contains existing data records (3593) that exceed the new length
I did find one post that suggested this could be done by an on load client script, but I havent got it to work, tried question.question_text and current.variables.variable_name
function onLoad() {
setTimeout(function() {
jQuery('input[name="current.variables.variable_name"').attr("maxlength","10");
}, 1000);
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-13-2023 07:42 AM
Hi @Cirrus ,
If you will set the field "Variable attribute" to "max_length=1000", It will allow the user to enter the input into field till max length of 1000 charater.
If the field "Variable attribute" is not present on your form in default view, just bring it out by configure->form layout option.
Thanks and Regards,
Rahul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-13-2023 07:08 AM
Hello @Cirrus
Greetings!
you can add variable attribute max_length=200
refer the below article:
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0718701
Please hit the thumb and Mark as correct based on Impact!!
Kind Regards,
Ravi Chandra

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-13-2023 07:37 AM
Ravi, I may be being a little stupid here, but the article says:
- Navigate to the variable of single-line text or wide single line-text on the platform
- Open the Default Value tab
- Add the variable in Variables of single-line text or wide single line-text
For example: max_length=150
What does line 3 actually mean? If I navigate to a single line text variable and put max_value=10 in the default value tab, it does just that, sets the default value of the field, not its length.
Also, is there a way to count characters in the portal. I know there is a system property in the UI.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-13-2023 07:48 AM
Hello @Cirrus
the article is little misguiding I'm afraid.
it's not the default value of the variable,
it is the default value of variable attribute. refer the below pic.
Please hit the thumb and Mark as correct based on Impact!!
Kind Regards,
Ravi Chandra
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-13-2023 07:50 AM
Hello @Cirrus
the property is glide.ui.textarea.character_counter property
Please hit the thumb and Mark as correct based on Impact!!
Kind Regards,
Ravi Chandra