limit single line text variable in RP form to 255 char

Amit Dey1
Tera Contributor

hi, we have a requirement to limit one Record producer text field variable chrarcter limit to 255 char , please help me in this issue.

 

 

Thanks in advance

7 REPLIES 7

Peter Bodelier
Giga Sage

Hi @Amit Dey1 

 

  1. Navigate to the variable of single-line text or wide single line-text
  2. Open the Default Value tab
  3. Add the variable in Variables of single-line text or wide single line-text
    For example: max_length=255

 

Source: https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0718701


Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.

Ankur Bawiskar
Tera Patron
Tera Patron

@Amit Dey1 

you can check link mentioned by Peter.

Please let us know if you are stuck

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Tai Vu
Kilo Patron
Kilo Patron

Hi @Amit Dey1 

Let's put this attribute "max_length=225" into the Variable attributes.

TaiVu_1-1698218023444.png

Service Catalog variable attributes

 

max_length
Sets the maximum number of characters allowed in the field. By default, the field accepts long strings of text, several thousand characters. Set the max_length attribute as appropriate for the information that the variable is collecting. For example, to allow for entry of an address, set max_length=200, or other appropriate length.

Applicable variables: Single-line text, Wide single-line text

 

 

Let me know if it works for you.

 

Cheers,

Tai Vu

Amit Dey1
Tera Contributor

hi @Peter Bodelier @Ankur Bawiskar @Tai Vu 

while typing the last 255th character , can we show any field message or error message that max 255 character reached?