How to Add a Character Counter and Limit to Multi-line Text Field in Service Portal Catalog Item?

Domi727
Tera Contributor

Hi everyone,

I'm working on a catalog item in the Service Portal (ESC), and I need to implement a character counter for a multi-line text field.

Here’s what I’m trying to achieve:

  • Limit the input to 1000 characters.
  • Display a live character counter below or beside the field.
  • Automatically truncate any excess characters beyond the limit.

I’ve tried using some client scripts and UI policies, but I’m not sure how to best approach this in the context of the Service Portal. Ideally, I’d like a solution that works seamlessly with the portal widgets and doesn’t require heavy customization.

 

image.png

 

Has anyone implemented something similar? Any guidance, code snippets, or best practices would be greatly appreciated!

 

Thanks in advance!

5 REPLIES 5

M Iftikhar
Kilo Sage

Hi @Domi727 ,

To set input limit to 1000 characters you can refer to the following community post:

Solved: Set Character limit on Multi-line Variables - ServiceNow Community

 

To Display a live character counter below or beside the field, refer the following link:

Solved: How to display counter for number of characters le... - ServiceNow Community

 

Thanks & Regards,
Muhammad Iftikhar
If my response helped, please mark it as the accepted solution so others can benefit as well.