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.

How to set character limitation on single text line variable

jituksingh
Kilo Guru

Hi all,

I have to set a character limitation on single and multi line text variable. I have several single line text variable and management wants that only a limited number of character should be allowed in those fields. Please let me know how can I do that?

Thanks in Advance!

Regards,

Jitendra Singh

1 ACCEPTED SOLUTION

bernyalvarado
Mega Sage
6 REPLIES 6

bernyalvarado
Mega Sage

The following should be helpful:



character limit on single line field


Chuck Tomasi
Tera Patron

You might find this thread helpful (despite the description)



Re: Single Line Text Variable Char Limit


Kalaiarasan Pus
Giga Sage

The easiest way would be to set the attribute of the variable as max_length=somevalue


Doesn't work.  It never saves.

Very lame that this happens.  It's absurd that you can't set max_length, and that you'd need to rely on an onSubmit script to handle it.

So, I personally get the maxlength attribute set by manipulating the DOM via an SP widget:

I have a Single Line Text field named "upc" as a Catalog Item Variable.

 

find_real_file.png

find_real_file.png

find_real_file.png